docs/index_update.md
While opening an index, if an updated mapping is provided as a string under the key updated_mapping within the runtimeConfig parameter of OpenUsing, then we open the index and try to update it to use the new mapping provided.
If the update fails, the index is unchanged and an error is returned explaining why the update was unsuccessful.
Fields can be partially deleted by changing their Index, Store, and DocValues parameters from true to false, or completely removed by deleting the field itself.
Additionally, document mappings can be deleted either by fully removing them from the index mapping or by setting the Enabled value to false, which deletes all fields defined within that mapping.
However, if any of the following conditions are met, the index is considered non-updatable.
_allSince the deletion is only done during merging, a force merge may be used to completely remove the stale data.
newMapping := `<Updated Index Mapping>`
config := map[string]interface{}{
"updated_mapping": newMapping,
}
index, err := bleve.OpenUsing("<Path to Index>", config)
if err != nil {
return err
}