You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by "R.A.Ittoo" <R....@rug.nl> on 2009/10/17 13:43:04 UTC

gettotalhits vs totalhits

hi
I am wondering what is the difference between

collector.getTotalHits();//where collector is a TopScoreDocCollector
(which returns the correct value for my example = 2 docs)

and

  collector.topDocs().totalHits (which returns 0, and is wrong)

the collector was used in a search: searcher.search(query,collector);

Strangely enough, collector.topDocs().scoreDocs.length; returns the 
correct value (length = 2)

Can anyone please advise when to use what (and what are the 
differences between the objects above)

ashwin

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