lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jake Mannix <jake.man...@gmail.com>
Subject Re: 2.9: TopScoreDocCollector
Date Thu, 08 Oct 2009 05:15:25 GMT
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
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message