Hi guys, I’ve got an issue trying to prioritize searches with a perfect match over exact match on multiple terms.
My index defines only a searchable attribute called name.
My ranking formula right now is the default Ranking Criteria followed by a custom ranking attribute counter (ordered desc) that contains an integer (website number of results for that term).
Typing “ecografia ginecologica”
I would like to prioritize record with name = “Ecografia ginecologica” (perfect match with counter = 45) over other records with the same words plus others like “Ecografia ginecologica 3D” (with counter = 65).
Looking at the Ranking information I can see that default Ranking criterias are exactly the same for the two items (matching on the first word, exact words count, proximity distance, typos, matching words, etc) so the two items are prioritized by the counter attribute which gives me that undesired result.
I tried to customize the ranking formula and also to reset it to defaults but it didn’t solved.
I was thinking about adding an extra attribute words_count to my item trying to prioritize records with “short” names (sorting asc) but it would interfere too much with the counter attribute since I only want to priorize the perfect match over other results. In ElasticSearch I would implement another not_analyzed field to execute this kind of match but I’m not sure it’s possible on Algolia.
Anyone tried anything like this? Any ideas?