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 Haroldo Nascimento <ha...@gmail.com> on 2007/11/23 21:46:21 UTC

Sorting and TopDocCollector

Hi,

  I am using TopDocCollector in IndexerSearher.search(...) for get the
BitSet of result, but I need of sort the result by two variable:  by
any term of document and by score. Is possible do it using Collector ?

  Have any form of use the method search(..., sort) and after get the
BitSet of result ?

  Thanks

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


Re: Sorting and TopDocCollector

Posted by Chris Hostetter <ho...@fucit.org>.
:   I am using TopDocCollector in IndexerSearher.search(...) for get the
: BitSet of result, but I need of sort the result by two variable:  by
: any term of document and by score. Is possible do it using Collector ?
: 
:   Have any form of use the method search(..., sort) and after get the
: BitSet of result ?

the HitCollector APIs are lower level and somewhat orthoginal to the Sort 
based APIs ... the APIs thattake a HitCollector ar designed to give *your* 
HitCollector all of the matches with as little overhead as possible -- you 
are free to do anything you want in the HitCollector, including keep track 
of the "best" results based on a particular sort.

Perhaps instead of subclassing TopDocCollector, you should look at 
TopFielDocCollector?


-Hoss


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