lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
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
results.

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.


-Hoss


---------------------------------------------------------------------
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