I'm using Lucene 5.3 to index a set of documents and use BooleanQuery
where each term in the query is boosted by some score.
My problem is when I search the index i get a lesser number of documents as hits than that are in my index.
System.out.println( "docs in the index = " + reader.numDocs() );
//e.g., docs in the index = 92
TopDocs topDocs = indexSearcher.search( q, reader.numDocs() ); //this ensures no result is omitted from the search.
ScoreDoc[] hits = topDocs.scoreDocs;
System.out.println( "results found: " + topDocs.totalHits )
//e.g., results found: 44
What is the reason for this behaviour? Does lucene ignore documents with a zero score?
How do I get all the documents in the index no matter what score they have?