Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.9: Relevancy changes #2852

Closed
1 task
guimachiavelli opened this issue Jun 11, 2024 · 1 comment · Fixed by #2872
Closed
1 task

v1.9: Relevancy changes #2852

guimachiavelli opened this issue Jun 11, 2024 · 1 comment · Fixed by #2872
Labels
new release Changes related upcoming Meilisearch releases
Milestone

Comments

@guimachiavelli
Copy link
Member

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.

Tasks

References

@irevoire
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new release Changes related upcoming Meilisearch releases
Projects
None yet
2 participants