Skip reindexing when modifying unknown faceted fields #4479
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Here is the hand-made test that shows that when modifying unknown filterable attributes, here
lol
, it doesn't reindex. However, when modifying the knowngenre
field, it does reindex. You can see all that by looking at the time spent processing the update.