Greetings,

We're working on an application for a client that uses Solr (via the acts_as_solr Rails plugin) to query a database of about 16 million business listings. Part of our client's strategy is to weigh matches on certain fields higher than others. We've been using Solr boosts to accomplish this. However, what they want is for only the match with the highest boost to figure into the relevancy. What we tried to do was a query something like

(field_a:Food^40 OR field_b:Food^30 OR field_c:Food^20 OR field_d:Food^10)

but from reading debugQuery output, assuming we search for "food", all four fields are matching and boosting the relevancy appropriately. What we need is a sort of short-circuiting OR operator; that is, once it matches one of the fields (in this case, field_a) it will stop evaluating everything else inside the parenthesized group and boost only by that first field (in this case, only the boost of 40.)

From my reading of Solr and Lucene documentation, it doesn't appear obvious that there's a way to do this. Has anyone ever tried to do something like this? If so, how did you do it? Thanks in advance for any help.


Mark Cornick, Web Developer/System Administrator, Viget Labs
[EMAIL PROTECTED]
http://www.viget.com/

Reply via email to