https://stackoverflow.com/questions/50368313/relation-between-topdocs-totalhits-and-parameter-n-of-indexsearcher-search

looks like someone else also had this problem, too.

Any suggestions please?

Best regards


On 6/8/21 1:36 AM, baris.ka...@oracle.com wrote:
Hi,-

 I use IndexSearcher.search API with two parameters like Query and int number (i set as 20).

However, when i look at the TopDocs object which is the result of this above API call

i see thousands of hits from totalhits. Is this inaccurate or Lucene is doing actually search based on that many results?

But when i iterate over result of above API call's scoreDocs object i get int number of hits (ie, 20 hits).


I am trying to find out why org.apache.lucene.search.Topdocs.TotalHits report a number of collected results than

the actual number of results. I see on the order of couple of thousands vs 20.


Best regards




---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

Reply via email to