lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Dueber <b...@dueber.com>
Subject Function query to boost scores by a constant if all terms are present
Date Tue, 17 Aug 2010 16:26:20 GMT
Let me describe what I'm trying to accomplish, first, since what I think is
the solution is almost always wrong. :-)

I'm doing dismax queries with mm set such that not all terms need to match,
e.g. only 2 of 3 query terms need to match.

Most of the time, items that match all three terms will float to the top by
normal ranking, but sometimes there are only two terms that are like a rash
across the record, and they end up with a higher score than some items that
match all three query terms.

I'd like to boost items with all the query terms to the top *without
changing their order*.

My first thought was to use a simple boost query allfields:(a AND b AND c),
but the order of the set of records that contain all three terms changes
when I do that. What I *think* I need to do is basically to say, "Hey, all
the items with all three terms get an extra 40,000 points, but change
nothing else".

I keep thinking I can get what I need with a subquery and map, but keep
failing.

Any advice would be very, very welcome.

 -Bill-



-- 
Bill Dueber
Library Systems Programmer
University of Michigan Library

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message