Some people tend to question the scholarship of the earliest scholars of the Ummah for the lack of written treatises coming down from them. Some tend to put to doubt their knowledge when they do not find explicit evidences for their legal opinions in well known books of Hadith compiled many years after their deaths.
In response to such notions Shaykhul Islam Imam Ibn Taymiyya argues;
ثُمَّ لَوْ فُرِضَ انْحِصَارُ حَدِيثِ رَسُولِ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ فيها, فَلَيْسَ كُلُّ مَا فِي الْكُتُبِ يَعْلَمُهُ الْعَالِمُ, وَلَا يَكَادُ ذَلِكَ يَحْصُلُ لِأَحَدِ, بَلْ قَدْ يَكُونُ عِنْدَ الرَّجُلِ الدَّوَاوِينُ الْكَثِيرَةُ وَهُوَ لَا يُحِيطُ بِمَا فِيهَا. بَلْ الَّذِينَ كَانُوا قَبْلَ جَمْعِ هَذِهِ الدَّوَاوِينِ كانوا أَعْلَمَ بِالسُّنَّةِ مِنْ الْمُتَأَخِّرِينَ بِكَثِيرِ؛ لِأَنَّ كَثِيرًا مِمَّا بَلَغَهُمْ وَصَحَّ عِنْدَهُمْ قَدْ لَا يَبْلُغُنَا إلَّا عَنْ مَجْهُولٍ؛ أَوْ بِإِسْنَادِ مُنْقَطِعٍ؛ أَوْ لَا يَبْلُغُنَا بِالْكُلِّيَّةِ, فَكَانَتْ دَوَاوِينُهُمْ صُدُورَهُمْ الَّتِي تَحْوِي أَضْعَافَ مَا فِي الدَّوَاوِينِ, وَهَذَا أَمْرٌ لَا يَشُكُّ فِيهِ مَنْ عَلِمَ الْقَضِيَّةَ
“If we were believe that the all the Ahadith of the Messenger of Allah (saaw) were confined to books, then no scholar knows all that is written in books and nor is it possible for anyone to know all. Instead, at times a person has many books with him but does not know all which it contains. In fact, those who came before the compilation of these books were much more knowledgeable than those that came after-wards. This is due to many Ahadith were authentic in there time but reached to us through an unknown narrator, or with a broken change, or did not reach us at all. Their books were their hearts which contained many folds more than what is contained in these [present] books. And this is something that a person with some understanding of the matter has not the slightest doubt.” (Raf’a al-Malam an al-Aimma al-‘Alaam p.17-18)
Indeed Allah knows the best!