I think you'll find the dismax request handler helpful in general, it supports more flexible query wrangling like that.

With the dismax request handler, I think the bq (boost query) parameter will do what you need, eg:

bq=city:Chicago^5.0

The ^5.0 is how much boost you want, you can play around with it to see what works well for your use cases.

http://wiki.apache.org/solr/DisMaxQParserPlugin



kenf_nc wrote:
I can't seem to find the right formula for this. I have a need to build a
query where one of the fields should boost the score, but not affect the
query if there isn't a match. For example, if I have documents with
restaurants, name, address, cuisine, description, etc.  I want to search on,
say,
Romantic AND View AND city:Chicago

if city is in fact Chicago it should score higher, but if city is not
Chicago (or even if it's missing the city field), but matches the other
query parameters it should still come back in the results. Is something like
this possible?  It's kind of like  q=(some query) optional boost if
field:value.

Thanks,
Ken

Reply via email to