I'm writing a service where other services can CRUD ElasticSearch. I'm have a schema that I stick to it to create POST body. I'm testing the service with Postman and I notice something unexpected. Just for giggles, I added a new
kew: value that was never included in a POST body. I noticed that I got a 200 on Postman. I opened Kibana and looked at
/_mapping and the new
key: value was there with types.
My question is how dynamic is ElasticSearch in that regard? Should I implement validation at the application layer? Is there a flag I can turn on in ES to avoid dynamic POST.
I kind of like the freedom of adding a new field and allow ES infer the type without
DELETE the index and moving the data to a new index with the new mappings.
- I created my dev index by creating a
JSONfile with 1K docs. I didn't create mappings first but rather did a bulk
POSTand let ES auto-create the mappings.
- I'm using ES 7.8
Thoughts about my assumptions?