Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Algolia have a boost score feature like Elasticsearch?

I have a requirement on sorting a field which is when a value matches its field, then this document has a higher score than other documents. Can Algolia do this?

like image 735
BambangLuPS Avatar asked Sep 19 '16 02:09

BambangLuPS


1 Answers

To reflect the importance of an attribute compared to another, the way to go using Algolia is definitely to order the attributes you want to search in in the searchableAttributes index setting.

For instance, if you want to search in both title and description, but title is more important; you should go for:

searchableAttributes:
 - title
 - description

Compared to the boosting approach, this ensures the number of match occurrences you have won't impact the overall ranking (common issue in ES is: is 4 words matching here and there in description better than 2 words matching exactly in title?).

With Algolia, the objects matching the longest expression (in terms of proximity between query words in the text) will always be used to identify the best matching attribute; and then to sort the results according to the attributes importance.

like image 86
redox Avatar answered Nov 17 '22 09:11

redox