lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Angel, Eric" <ean...@business.com>
Subject RE: 2.9: TopScoreDocCollector
Date Fri, 09 Oct 2009 00:24:04 GMT
Thanks.  Makes sense.

-----Original Message-----
From: Jake Mannix [mailto:jake.mannix@gmail.com] 
Sent: Wednesday, October 07, 2009 10:15 PM
To: java-user@lucene.apache.org
Subject: Re: 2.9: TopScoreDocCollector

Hi Eric,

  Different Query classes have different options on whether they can
score
docs out of order, or if they always proceed in order, so the way to
make
sure
you're choosing the right value, if you don't know which you need, is to
ask
your Query (or more appropriately, it's Weight):

   Query query = myBuildQueryMethod();
   IndexSearcher searcher = myBuildSearcherMethod();
   Weight weight = query.weight(searcher);
   boolean allowOutOfOrder = weight.scoresDocsOutOfOrder();

   TopScoreDocCollector coll = TopScoreDocCollector.create(numHits,
allowOutOfOrder);
   searcher.search(weight, (Filter) null, coll);


  -jake

On Wed, Oct 7, 2009 at 7:26 PM, Angel, Eric <eangel@business.com> wrote:

> According to the documentation for 2.9,
> TopScoreDocCollector.create(numHits, boolean), the second parameter is
> whether documents are scored in order by the input - How do I choose?
> In other words, how would I know if the documents are scored in order
or
> not?
>
>
>
> Eric
>
>

---------------------------------------------------------------------
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