lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hel...@aeiou.pt
Subject Re: Restrict number of hits
Date Sun, 12 May 2002 00:41:03 GMT
> Hi,
>
> The FAQ answer on this one is
>
> 17. How can I restrict the number of hits ?
>
> As far as we know, there is no way at this time (Lucene 1.0, May 
2001) to
> instruct Lucene to collect only a specified number of hits. 
However, when
> you get the hit list back from the search method, you can ignore 
the ones
> you don't need. 
>
>
>
> It doesn't seem to be a problem to have many hits because 
internally only
> the first 200 (I think that's the right number), are kept in an 
active
> stac> k
> to start.  It will grab more if necessary. Also, Lucene is 
optimized to not
> get the Hit information from the index until it is required.
>
> Why are you trying to restrict the total hits?
I didn't knew that only the first 200 are returned at the beginning. 
I'm trying to use lucene not only as a Indexing Engine but also as a 
Entry Tracker to get the latest entries that respect some given 
conditions. If all the returned documents have the same score, it's 
guaranteed that the first 200 returned are the last ones that were 
published?

../ 
Hélder Ribeiro


>
> --Peter
>
>
> On 5/10/02 10:42 AM, "helrib@aeiou.pt" <helrib@aeiou.pt> wrote:
>
> > there any way to restrict the number of hits returned by a query?
> > I would like to have the functionality of getting only the X last
> > documents which respect to a given query condition. I've seen
> > something on making an HitCollector class, but if there is a 
plenty
> > more than X documents which respect the condition, that doesn't 
mean
> > that they would all be processed? How can I avoid that?
> > 
> > Thanks in advance,
> >  Hélder Ribeiro

__________________________________________________________
Queima das Fitas do Porto 5 a 12 de Maio
Reserve bilhetes online em http://queima2002.aeiou.pt

--
To unsubscribe, e-mail:   <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>


Mime
View raw message