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: complex search
Date Mon, 31 Oct 2005 19:56:53 GMT

: I want to implement search which in SQL equivalent looks like
: select itemId, min(price) from <table>
:     where <condition on otherFields>
:     groupBy itemId

: Is it possible to achieve?


Not easily.  The most straightforward approach I can think of is to write
your own HitCollector that builds up a Hash of itemId => price mappings
for each docId it sees with a positive score, and only overright existing
mappings if the price it sees is less then the previous price.

To make it efficient, you're going to want to make sure itemId and price
are both indexed fields, and use the FieldCache.



-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