Does Algolia have a boost score feature like Elasticsearch?
Asked Answered
G

1

7

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?

Gupton answered 19/9, 2016 at 2:23 Comment(1)
Obviously not quite the same, but you can tell the Algolia the searchable fields and there order of importance.Whaleback
R
0

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.

Ragouzis answered 19/12, 2016 at 10:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.