On Tue, Aug 3, 2010 at 2:42 PM, oleg.gnatovskiy <crooke...@gmail.com> wrote: > > Oh sorry guys, I didn't correctly submit my original post to the mailing > list. The original message was this: > " > Hello all. We are having some trouble with queries similar to the type shown > below: > > name: pizza OR (id:10 OR id:20 OR id:30) (id is a multi-valued field) > > With the above query, we will always get documents with pizza in the name, > and any document with id values of 10, 20, and 30 will always come up first. > What we would like is to have a document with only id 10 to be weighted the > same as a document with ids 10, 20, and 30.
How do you want pizza weighted against 10, 20, or 30? If pizza can always come first, you can boost the second clause to zero: pizza OR (id:10 OR id:20 OR id:30)^0 > What happens is that the sums of all the hits on ID are added up. Is there a > way to only grab the first score? There is a way to grab only the highest score from a set of options (DisjunctionMaxQuery) but unfortunately there is no general query parser syntax to support that yet. -Yonik http://www.lucidimagination.com