I am requesting a solr server for locations. These location documents also have a "country_code" field that contains values ββsuch as US, GB, DE, ...
In certain circumstances, I want to improve results using specific country codes so that I can prioritize my results by country.
For instance:
?q=york
Let's say a user from the UK is looking for York ... At that moment, he first finds in New York in the USA, and then in England.
I want to be able to indicate that for this query, British results should be on top. I found that this should be possible through dismax and bq, something like this:
?q=york&dismax=true&bq=country_code:GB^20.0
But this does not work as expected, now York from Guatemala (country_code GT) is on top, GB is not visible.
Help me please: -)
source share