lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: Need a way to set a result limit on a particular field
Date Wed, 15 Jun 2005 00:58:11 GMT

On Jun 14, 2005, at 7:23 PM, Jay Hill wrote:
> I have a need to limit my Hits returned based on one of the indexed
> fields. This is a web application and we want to limit the number of
> hits from any one host. We have a field named "host_id" and I'd like
> to be able to limit my results to no more than three results for any
> one host_id.

I may not be fully understanding your question, but I'll go with my  
assumptions... wrap the users query into a BooleanQuery as a required  
clause and then add another clause with a TermQuery for the specific  
host_id.  Then simply constrain the number of Hits shown to the first  
3.  Does that do what you're after?


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

View raw message