You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
v1.9 no longer takes attribute order in consideration when ranking documents in indexes using the default value for searchableAttributes, [*].
Behaviour remains the same when searchableAttributes has been configured, however. If searchableAttributes: ["title", "description"], matches in title will be more important than matches in description.
v1.9 no longer takes attribute order in consideration when ranking documents in indexes using the default value for searchableAttributes, [*].
FIY, that’s not exactly what was happening before.
Before v1.9, we were using the first order of apparition of the fields, which means that if you sent:
[
{
"id": "the human tamo",
"favorite beverage": "kefir"
},
{
"favorite beverage": "milk",
"id": "the doggo kefir"
}
]
The internal searchable attributes generated would have been ["id", "favorite beverage"] even though the second document used a different order. (They'll also be returned in the ordering found by the engine in case of a search request.)
And now, regarding relevancy changes, if I were searching for kefir before v1.9, I would get the second document first as it contains the word kefir in its « first » field (from the pov of the engine).
While, after v1.9, the first document will be returned first.
Since all fields share the same importance, the only thing that matters here is how close kefir is from the beginning of the field.
I'm not sure it'll really help you to write the documentation, but I just wanted to clarify why the previous behavior didn't make much sense and was only implemented this way for technical reasons.
v1.9 no longer takes attribute order in consideration when ranking documents in indexes using the default value for
searchableAttributes
,[*]
.Behaviour remains the same when
searchableAttributes
has been configured, however. IfsearchableAttributes: ["title", "description"]
, matches intitle
will be more important than matches indescription
.Tasks
References
The text was updated successfully, but these errors were encountered: