i work with solr, i can't fix my problem of result's accuracy (q vs bf taking into account accents)
i have a solr index with 2 fields indexed (this is simplified):
town, population
Félines, 100
Ferrand, 10000
when i query: q=Fé&qf=town town_ascii&bf=population^2&defType=dismax
I'd like this order on my results : Félines > Ferrand
.
When i query: q=Fe&qf=town town_ascii&bf=population^2&defType=dismax
I'd like this order on my results : Ferrand > Félines
The trouble is that Ferrand beats every time Félines because its population is bigger, how can i solve that? I didn't find how to use the score of the query and use it in bf
to balance population
You didn't post your schema.xml
but I suppose you're using the ASCIIFoldingFilterFactory
for the town_ascii
field. It means that if you're indexing the word Félines the following are the indexed terms:
town: Félines
town_ascii: Felines
Therefore, you're saying that a match for the town
field is more important than a match for town_ascii
. You should change the qf
parameter to something like qf=town^3 town_ascii
to give more weight to the town
field. Then you can adjust the weight depending on what is the desired weight for town
compared to population
.