lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <...@thetaphi.de>
Subject RE: 2.9: TopScoreDocCollector
Date Thu, 08 Oct 2009 05:19:46 GMT
The simpliest is (and also recommended): Do not create such collectors for
yourself. Just use the Query methods returning TopDocs.

The developers of these classes strongly discourage direct use, as a lot of
automatism is ignored then.

Uwe

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de


> -----Original Message-----
> From: Jake Mannix [mailto:jake.mannix@gmail.com]
> Sent: Thursday, October 08, 2009 7:15 AM
> 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