legrego / homeassistant-elasticsearch

Publish Home-Assistant events to Elasticsearch
https://legrego.github.io/homeassistant-elasticsearch/
MIT License
143 stars 38 forks source link

Strict dynamic mapping is going to cause issues #299

Open strawgate opened 2 weeks ago

strawgate commented 2 weeks ago

Our use of strict dynamic mappings instead of false means that extra fields cause document rejection instead of just ignoring the non-matching fields.

This means we cannot add fields to documents as updating the index template doesnt take effect until the datastream performs rollover.

We need to either:

  1. Quickly update 0.7.0 with dynamic mappings set to false and provide instructions on how to manually rollover indices
  2. Check if the current index_template has dynamic mappings set to true and perform a one-off update of the dynamic setting for the current write indices of all open datastreams via PUT /my-data-stream/_mapping?write_index_only=true with the new value for the dynamic setting
strawgate commented 2 weeks ago

Included option 2 in https://github.com/legrego/homeassistant-elasticsearch/pull/290

legrego commented 2 weeks ago

Included option 2 in #290

I'm good with this approach, thanks.