Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Relevancy impacted by settings added before first document #294

Closed
bidoubiwa opened this issue Jul 13, 2021 · 2 comments · Fixed by #293
Closed

Relevancy impacted by settings added before first document #294

bidoubiwa opened this issue Jul 13, 2021 · 2 comments · Fixed by #293
Assignees

Comments

@bidoubiwa
Copy link
Contributor

Describe the bug
related to meilisearch/meilisearch#1495

When filters are added before the first document they will be implicitly added in the searchableAttributes. After which the
attributes found in new documents will be added in order of appearance.

To Reproduce

  1. Add settings filterableAttributes: "genres"
  2. Add documents with the following fields: id, title, genres, ..
  3. Thus the implicit value of searchableAttributes becomes * == ["genres", "id", "title",...]

Now given a concrete example, here is a dataset:

[
  {
    id: 11,
    title: 'Star Wars',
    overview:
      'Princess Leia is captured and held hostage by the evil Imperial forces in their effort to take over the galactic Empire. Venturesome Luke Skywalker and dashing captain Han Solo team together with the loveable robot duo R2-D2 and C-3PO to rescue the beautiful princess and restore peace and justice in the Empire.',
    genres: ['Adventure', 'Action', 'Science Fiction'],
    poster: 'https://image.tmdb.org/t/p/w500/6FfCtAuVAW8XJjZ7eWeLibRLWTw.jpg',
    release_date: 233366400,
  },
  {
    id: 30,
    title: 'Magnetic Rose',
    overview: '',
    genres: ['Animation', 'Science Fiction'],
    poster: 'https://image.tmdb.org/t/p/w500/gSuHDeWemA1menrwfMRChnSmMVN.jpg',
    release_date: 819676800,
  },
]

When doing a search on query = S I will receive Magnetic Rose instead of Star Wars.

Expected behavior
This behavior impacts the relevancy in an unexpected way(see example above). It also go against what is written in the documentation.

This means that the initial order will be based on the order of attributes in the first document indexed, with each new attribute found in subsequent documents added at the end of this list.

If we keep this behavior it has an impact on the documentation as. There are occurrences where we ask user to first add settings and then documentation. We suggest this to avoid two complete indexation of the dataset.
We now have to suggest the opposite. On big datasets this means 2*times indexation time.

MeiliSearch version:
0.21.0

@curquiza curquiza changed the title V0.21 Relevancy impacted by settings added before first document Relevancy impacted by settings added before first document Jul 26, 2021
@curquiza curquiza transferred this issue from meilisearch/meilisearch Jul 26, 2021
@curquiza
Copy link
Member

I transferred this issue to Milli since it's a fix to do on Milli's side.
This new issue is opened on MeiliSearch's side: meilisearch/meilisearch#1529

@curquiza
Copy link
Member

Closed by #293

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants