homeassistant-elasticsearch icon indicating copy to clipboard operation
homeassistant-elasticsearch copied to clipboard

Strict dynamic mapping is going to cause issues

Open strawgate opened this issue 1 year ago • 2 comments
trafficstars

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 avatar May 01 '24 03:05 strawgate

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

strawgate avatar May 01 '24 03:05 strawgate

Included option 2 in #290

I'm good with this approach, thanks.

legrego avatar May 02 '24 12:05 legrego