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

Skip reindexing when modifying unknown faceted fields #4479

Merged
merged 1 commit into from Mar 13, 2024

Conversation

Kerollmops
Copy link
Member

@Kerollmops Kerollmops commented Mar 12, 2024

This PR improves Meilisearch's decision to reindex when a faceted field is added to the settings, but not a single document contains this field. It is effectively a waste of time to reindex documents when the engine needs to know a field.

This is related to a conversation we have with our biggest customer (internal link). They have 170 million documents, so reindexing this amount would be problematic.


The image is available by using the following Docker command. You can see the advancement of the image's build on the GitHub CI page.

docker pull getmeili/meilisearch:prototype-no-reindex-unknown-fields-0

Here is the hand-made test that shows that when modifying unknown filterable attributes, here lol, it doesn't reindex. However, when modifying the known genre field, it does reindex. You can see all that by looking at the time spent processing the update.

{
  "uid": 3,
  "indexUid": "movies",
  "status": "succeeded",
  "type": "settingsUpdate",
  "canceledBy": null,
  "details": {
    "filterableAttributes": [
      "genres"
    ]
  },
  "error": null,
  "duration": "PT9.237703S",
  "enqueuedAt": "2024-03-12T15:34:26.836083Z",
  "startedAt": "2024-03-12T15:34:26.836374Z",
  "finishedAt": "2024-03-12T15:34:36.074077Z"
},
{
  "uid": 2,
  "indexUid": "movies",
  "status": "succeeded",
  "type": "settingsUpdate",
  "canceledBy": null,
  "details": {
    "filterableAttributes": [
      "lol"
    ]
  },
  "error": null,
  "duration": "PT0.000751S",
  "enqueuedAt": "2024-03-12T15:33:53.563923Z",
  "startedAt": "2024-03-12T15:33:53.565259Z",
  "finishedAt": "2024-03-12T15:33:53.56601Z"
},
{
  "uid": 0,
  "indexUid": "movies",
  "status": "succeeded",
  "type": "documentAdditionOrUpdate",
  "canceledBy": null,
  "details": {
    "receivedDocuments": 31944,
    "indexedDocuments": 31944
  },
  "error": null,
  "duration": "PT3.120723S",
  "enqueuedAt": "2024-02-17T10:35:55.042864Z",
  "startedAt": "2024-02-17T10:35:55.043505Z",
  "finishedAt": "2024-02-17T10:35:58.164228Z"
}

@Kerollmops Kerollmops added the enhancement New feature or improvement label Mar 12, 2024
@Kerollmops Kerollmops changed the base branch from main to release-v1.7.0 March 12, 2024 16:00
@Kerollmops Kerollmops added this to the v1.7.1 milestone Mar 13, 2024
@Kerollmops Kerollmops changed the base branch from release-v1.7.0 to release-v1.7.1 March 13, 2024 14:44
@Kerollmops Kerollmops marked this pull request as ready for review March 13, 2024 14:51
Copy link
Contributor

@dureuill dureuill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bors merge

Copy link
Contributor

meili-bors bot commented Mar 13, 2024

@meili-bors meili-bors bot merged commit d2f77e8 into release-v1.7.1 Mar 13, 2024
11 checks passed
@meili-bors meili-bors bot deleted the no-reindex-for-unknown-faceted-field branch March 13, 2024 17:05
@meili-bot meili-bot added the v1.7.1 PRs/issues solved in v1.7.1 label Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement v1.7.1 PRs/issues solved in v1.7.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants