-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Description
I was looking into failing the build when we accidentally use deprecated syntax in the docs (a fairly annoying problem to users) and I noticed (again) that we have index.query.parse.strict. It is supposed to fail any request that uses deprecated syntax. But we don't really test it so far as I can tell. We test the ParseField supports strict matching but not the setting that enables it from the outside.
So I played with the setting and I'm pretty sure it doesn't work at all now. At least, not in any way I expect it to work. You can't set the setting in elasticsearch.yaml. You can't set it in index settings. You can't set it on a url. This seems bad.
I'm not really sure what we should do about it too. Personally, I'd love to be able to control the setting on a request level and the cluster level. That'd be super useful in the docs because you could turn it on in elasticsearch.yaml and then fail all the deprecated requests unless they were marked as "deprecated" somehow. No more deprecated syntax sneaking into the docs.
But there is also the index level - we use it for things like "is it ok to use off instead of false?" Should the setting live at the index level too? If it does does it only affect mappings and settings on that level or does it affect all interactions with the index? What happens if you do a search across multiple indexes that have different values for the setting? This all feels like overkill for this setting.
To top it all off the way this setting flows around the code is kind of odd. We have ParseFieldMatcher which holds the setting and extracts it from a Settings instance. We aren't particularly careful with which Settings instance we build the ParseFieldMatcher using. Usually it is the global one but because we build ParseFieldMatcher a ton of times in the code it is difficult to tell for sure.