It is reported that Imaam Bukhaari (rahimahullah) compiled the Saheeh Bukhaari over a period of sixteen years. He selected the Ahaadith for this kitaab from a total of six hundred thousand Ahaadith. Imaam Bukhaari (rahimahullah) mentioned, “I only placed authentic Ahaadith in my kitaab. However, there are much more authentic Ahaadith which I have not included in my kitaab, the number of which surpass the number of authentic Ahaadith in my kitaab.”
The Reason for Compiling Saheeh Bukhaari
Imaam Bukhaari (rahimahullah) was once seated in the class of his ustaad, Imaam Ishaaq bin Raahwayh (rahimahullah), when Imaam Ishaaq (rahimahullah) said to the students, “It would be good if some of you compile a kitaab which only contains authentic Ahaadith of Rasulullah (sallallahu ‘alaihi wasallam)” Imaam Bukhaari (rahimahullah) took the instruction of his ustaad to heart and thus commenced compiling Saheeh Bukhaari.
Imaam Bukhaari (rahimahullah) also mentions the following regarding the reason for him compiling the Saheeh Bukhaari, “I had a dream in which I saw myself standing before Rasulullah (sallallahu ‘alaihi wasallam) and fanning flies away from him. When I awoke, I went to a person who was knowledgeable in the science of interpreting dreams and narrated the dream to him. He said to me, ‘The interpretation of the dream is that you will repel lies and fabrications from (the Ahaadith of) Rasulullah (sallallahu ‘alaihi wasallam).’ This is what motivated me to compile my kitaab.”
(Hadyus Saari pg. 7 and 491-492, Tadreeb-ur-Raawi 1/96)