Do you want the first 2 docs, regardless of score, with the same property or do you want the 2 highest scoring docs with the same property?

You might look at the HitCollector search method on IndexSearcher. Btw, the Filter that is required can be null. The HitCollector interface allows you to apply business rules to a document as it is being scored and store them how you see fit.

I am not sure you will see much performance gain, as Lucene is pretty fast. Have you done profiling, etc. to determine that Lucene is actually the bottleneck?

-Grant



emerson cargnin wrote:
does anyone knows a solution for that?
I know theres a method that returns a TopDoc, but it needs a filter, and in
my case, Ill need the first 2 of each doc with the same value in a given
property.


On 27/02/06, emerson cargnin <[EMAIL PROTECTED]> wrote:
Hi all

Due a performance problem, I'm looking a way of restricting the docs
returned based of the number of docs which a field has the same value. At
the moment we just discard the docs if more than a X number for the same
field, but I think it can be done by lucence, hence improving a lot the
performance, as now it can return a hundred of docs for the the field value,
when just the first 4-5 will be really used.

thanks
Emerson



--
------------------------------------------------------------------- Grant Ingersoll Sr. Software Engineer Center for Natural Language Processing Syracuse University School of Information Studies 335 Hinds Hall Syracuse, NY 13244 http://www.cnlp.org Voice: 315-443-5484 Fax: 315-443-6886

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to