mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-09 14:34:43 +00:00
isHidden was a `Boolean` in order to treat a special case identified with V1 templates where if the create index request didn't specify if the index should be hidden or not (ie. isHidden was `null`) but the index matched a template that specified the `index.hidden` setting we needed to remove the global templates from the templates we'll apply to the new index (note: this is important with V1 templates as inheritance is supported). With V2 templates we match only one template with an index so the equivalent check did not need to exist (we added a sanity check in https://github.com/elastic/elasticsearch/pull/55015 where we make sure we don't apply an invalid global template - one that specifes the `index.hidden` setting, but this is a check we make irrespective of the user specifying or not if the index should be hidden) This commit makes `isHidden` when matching V2 templates a boolean primitive, eliminating the need for the `null` state to exist. Note that some methods which use the matching V2 templates still work with a `Boolean` object `isHidden` attribute as they are also matching the V1 templates. These methods will pass in `false` instead of `null` when finding the V2 templates. (cherry picked from commit c5b923afec911c6ae8fc5179e65ae6bf55dcc5f1) Signed-off-by: Andrei Dan <andrei.dan@elastic.co>