kuzzle
kuzzle copied to clipboard
Mappings update should trigger a reindex
Feature description
When updating mappings on a collection to add new fields, if there are existing documents with those new fields, they still won't be searchable. To include those documents, a reindex should be triggered (see here: https://www.elastic.co/guide/en/elasticsearch/reference/7.9/docs-update-by-query.html#picking-up-a-new-property)
Our mappings update actions should probably do that by default.
Example usecase
Create a collection with dynamic: 'false' and no mappings.
Add a few documents in it.
Then add mappings to describe the fields in the added documents.
Expected: running a document:search in the collection should return the searched documents. Obtained result: documents existing prior to the mappings update do not appear in the results without a manual reindex.