lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantyn Smirnov <>
Subject HitCollector and sorting
Date Mon, 02 Jun 2008 15:44:11 GMT

Hi all 

Currently I'm using the search method returning the Hits object. According
to one should use a
HitCollector-oriented search method instead. 
But I need another aspect of the "Hits search(...)" method: it's sorting

Now my code looks like :

    def hits = query, Methods.activeFilter, sort )
    def iter = hits.iterator()
    def results = []
    int counter = 0
    for( hit in iter ){
      if( range.contains( counter ) && hit.document ){
        results << Methods.bind( hit.document, lucenizedClasses )
      }else if( counter >= upper ) break

So, how can I get the same results using the HitCollector? Also it would be
really nice, if you could point me to some examples of using it...

Thanx in advance,
View this message in context:
Sent from the Lucene - Java Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message