lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "R.A.Ittoo" <R.A.It...@rug.nl>
Subject gettotalhits vs totalhits
Date Sat, 17 Oct 2009 11:43:04 GMT
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


Mime
View raw message