All,
Issue: Unable to get the proper results after searching. I added sample code
which I used in the application.
If I used *numHitPerPage* value as 1000 its giving expected results.
ex: The expected results is 32 docs but showing 32 docs
Instead If I use *numHitPerPage* as 2^32-1 its not giving expected results.
ex: The expected results is 32 docs but showing only 29 docs.
Sample code below:
StandardAnalyzer analyzer = new StandardAnalyzer(Version.LUCENE_CURRENT);
QueryParser qp = new QueryParser(Version.LUCENE_CURRENT, defField,
analyzer);
Query q = qp.parse(queryString);
TopDocsCollector tdc = TopScoreDocCollector.create(*numHitPerPage*, true);
IndexSearcher(is).search(q,tdc);
ScoreDocs[] noDocs = tdc.topDocs().scoreDocs;
Please let me know if any other way to search?
Thanks.
Kiran. M
|