lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: colapsing the result by a given field
Date Sun, 12 Mar 2006 22:11:38 GMT

: What would be the easiest to achieve that?

The easiest way is to do the search 10 times, and use either a Filter or a
BooleanQuery with a mandatory companyId:XXX clause in each to restrict the

Which appraoch you take depends on how many total companies might be used
over time, and wether individual companies are re-searched over and over
again so that caching the FIlter BitSet is advantages.

A more complicated way that could concievable be faster, is to use a
HItCollector, and a the FieldCache on your companyId field to record the
highest scoring doc for each companyId ... but that's a lot more work, and
if you are really only going to be dealing with 1-10 companies at a time,
issuing the search 10 teams really isn't that bad.


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

View raw message