---
setup:
- skip:
    features:
    - "headers"
    - "allowed_warnings_regex"
---
Component and index template composition:
- requires:
    cluster_features:
    - "gte_v7.8.0"
    reason: "index template v2 API unavailable before 7.8"
    test_runner_features: "allowed_warnings"
- do:
    cluster.put_component_template:
      name: "ct_low"
      body:
        template:
          settings:
            number_of_replicas: 1
          mappings:
            properties:
              field1:
                type: "text"
          aliases:
            aliasname:
              is_write_index: false
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- do:
    cluster.put_component_template:
      name: "ct_high"
      body:
        template:
          settings:
            index.number_of_replicas: 0
          mappings:
            properties:
              field2:
                type: "keyword"
          aliases:
            aliasname:
              is_write_index: true
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- do:
    allowed_warnings:
    - "index template [my-template] has index patterns [foo, bar-*] matching patterns\
      \ from existing older templates [global] with patterns (global => [*]); this\
      \ template [my-template] will take precedence during new index creation"
    indices.put_index_template:
      name: "my-template"
      body:
        index_patterns:
        - "foo"
        - "bar-*"
        template:
          settings:
            index.number_of_shards: 2
          mappings:
            properties:
              field3:
                type: "integer"
          aliases:
            my_alias: {}
            aliasname:
              filter:
                match_all: {}
        composed_of:
        - "ct_low"
        - "ct_high"
        priority: 400
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- do:
    indices.create:
      index: "bar-baz"
      body:
        settings:
          index.priority: 17
        mappings:
          properties:
            foo:
              type: "keyword"
        aliases:
          other: {}
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- do:
    indices.get:
      index: "bar-baz"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- match:
    bar-baz.settings.index.number_of_shards: "2"
- match:
    bar-baz.settings.index.number_of_replicas: "0"
- match:
    bar-baz.settings.index.priority: "17"
- match:
    bar-baz.mappings.properties.field1:
      type: "text"
- match:
    bar-baz.mappings.properties.field2:
      type: "keyword"
- match:
    bar-baz.mappings.properties.field3:
      type: "integer"
- match:
    bar-baz.mappings.properties.foo:
      type: "keyword"
- match:
    bar-baz.aliases.aliasname:
      filter:
        match_all: {}
- match:
    bar-baz.aliases.my_alias: {}
- match:
    bar-baz.aliases.other: {}
---
Index template priority:
- requires:
    cluster_features:
    - "gte_v7.8.0"
    reason: "index template v2 API unavailable before 7.8"
    test_runner_features: "allowed_warnings"
- do:
    allowed_warnings:
    - "index template [my-template] has index patterns [foo, bar-*] matching patterns\
      \ from existing older templates [global] with patterns (global => [*]); this\
      \ template [my-template] will take precedence during new index creation"
    indices.put_index_template:
      name: "my-template"
      body:
        index_patterns:
        - "foo"
        - "bar-*"
        template:
          settings:
            index.number_of_shards: 2
        composed_of: []
        priority: 400
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- do:
    allowed_warnings:
    - "index template [another-template] has index patterns [bar-*] matching patterns\
      \ from existing older templates [global] with patterns (global => [*]); this\
      \ template [another-template] will take precedence during new index creation"
    indices.put_index_template:
      name: "another-template"
      body:
        index_patterns:
        - "bar-*"
        template:
          settings:
            index.number_of_shards: 3
        composed_of: []
        priority: 405
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- do:
    indices.create:
      index: "bar-baz"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- do:
    indices.get:
      index: "bar-baz"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- match:
    bar-baz.settings.index.number_of_shards: "3"
---
Component template only composition:
- requires:
    cluster_features:
    - "gte_v7.8.0"
    reason: "index template v2 API unavailable before 7.8"
    test_runner_features: "allowed_warnings"
- do:
    cluster.put_component_template:
      name: "ct_low"
      body:
        template:
          aliases:
            alias1: {}
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- do:
    cluster.put_component_template:
      name: "ct_high"
      body:
        template:
          mappings:
            properties:
              field:
                type: "keyword"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- do:
    allowed_warnings:
    - "index template [my-template] has index patterns [baz*] matching patterns from\
      \ existing older templates [global] with patterns (global => [*]); this template\
      \ [my-template] will take precedence during new index creation"
    indices.put_index_template:
      name: "my-template"
      body:
        index_patterns:
        - "baz*"
        composed_of:
        - "ct_low"
        - "ct_high"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- do:
    indices.create:
      index: "bazfoo"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- do:
    indices.get:
      index: "bazfoo"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- match:
    bazfoo.mappings.properties.field:
      type: "keyword"
- match:
    bazfoo.aliases.alias1: {}
---
Index template without component templates:
- requires:
    cluster_features:
    - "gte_v7.8.0"
    reason: "index template v2 API unavailable before 7.8"
    test_runner_features: "allowed_warnings"
- do:
    allowed_warnings:
    - "index template [my-template] has index patterns [eggplant] matching patterns\
      \ from existing older templates [global] with patterns (global => [*]); this\
      \ template [my-template] will take precedence during new index creation"
    indices.put_index_template:
      name: "my-template"
      body:
        index_patterns:
        - "eggplant"
        template:
          settings:
            number_of_shards: 3
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- do:
    indices.create:
      index: "eggplant"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- do:
    indices.get:
      index: "eggplant"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- match:
    eggplant.settings.index.number_of_shards: "3"
---
Index template mapping merging:
- requires:
    cluster_features:
    - "gte_v7.9.0"
    reason: "index template v2 mapping merging not available before 7.9"
    test_runner_features: "allowed_warnings"
- do:
    cluster.put_component_template:
      name: "red"
      body:
        template:
          mappings:
            properties:
              object1.red:
                type: "keyword"
              object2.red:
                type: "keyword"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- do:
    cluster.put_component_template:
      name: "blue"
      body:
        template:
          mappings:
            properties:
              object2.red:
                type: "text"
              object1.blue:
                type: "text"
              object2.blue:
                type: "text"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- do:
    allowed_warnings:
    - "index template [blue] has index patterns [purple-index] matching patterns from\
      \ existing older templates [global] with patterns (global => [*]); this template\
      \ [blue] will take precedence during new index creation"
    indices.put_index_template:
      name: "blue"
      body:
        index_patterns:
        - "purple-index"
        composed_of:
        - "red"
        - "blue"
        template:
          mappings:
            properties:
              object2.blue:
                type: "integer"
              object1.purple:
                type: "integer"
              object2.purple:
                type: "integer"
              nested:
                type: "nested"
                include_in_root: true
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- do:
    indices.create:
      index: "purple-index"
      body:
        mappings:
          properties:
            object2.purple:
              type: "double"
            object3.purple:
              type: "double"
            nested:
              type: "nested"
              include_in_root: false
              include_in_parent: true
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- do:
    indices.get:
      index: "purple-index"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- match:
    purple-index.mappings.properties.object1.properties.red:
      type: "keyword"
- match:
    purple-index.mappings.properties.object1.properties.blue:
      type: "text"
- match:
    purple-index.mappings.properties.object1.properties.purple:
      type: "integer"
- match:
    purple-index.mappings.properties.object2.properties.red:
      type: "text"
- match:
    purple-index.mappings.properties.object2.properties.blue:
      type: "integer"
- match:
    purple-index.mappings.properties.object2.properties.purple:
      type: "double"
- match:
    purple-index.mappings.properties.object3.properties.purple:
      type: "double"
- is_false: "purple-index.mappings.properties.nested.include_in_root"
- is_true: "purple-index.mappings.properties.nested.include_in_parent"
---
Index template ignore_missing_component_template valid:
- requires:
    cluster_features:
    - "gte_v8.7.0"
    reason: "index template v2 ignore_missing_component_template config not available\
      \ before 8.7"
    test_runner_features: "allowed_warnings"
- do:
    cluster.put_component_template:
      name: "red"
      body:
        template:
          mappings:
            properties:
              foo:
                type: "keyword"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- do:
    allowed_warnings:
    - "index template [blue] has index patterns [purple-index] matching patterns from\
      \ existing older templates [global] with patterns (global => [*]); this template\
      \ [blue] will take precedence during new index creation"
    indices.put_index_template:
      name: "blue"
      body:
        index_patterns:
        - "purple-index"
        composed_of:
        - "red"
        - "blue"
        ignore_missing_component_templates:
        - "blue"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- do:
    indices.create:
      index: "purple-index"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- do:
    indices.get:
      index: "purple-index"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- match:
    purple-index.mappings.properties.foo:
      type: "keyword"
---
Index template ignore_missing_component_template invalid:
- requires:
    cluster_features:
    - "gte_v8.7.0"
    reason: "index template v2 ignore_missing_component_template config not available\
      \ before 8.7"
    test_runner_features: "allowed_warnings"
- do:
    cluster.put_component_template:
      name: "red"
      body:
        template:
          mappings:
            properties:
              foo:
                type: "keyword"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- do:
    catch: "/index_template \\[blue\\] invalid, cause \\[index template \\[blue\\\
      ] specifies a missing component templates \\[blue\\] that does not exist/"
    indices.put_index_template:
      name: "blue"
      body:
        index_patterns:
        - "purple-index"
        composed_of:
        - "red"
        - "blue"
        ignore_missing_component_templates:
        - "foo"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
---
'Composable index templates that include subobjects: false at root':
- requires:
    cluster_features: "gte_v8.11.0"
    reason: "https://github.com/elastic/elasticsearch/issues/96768 fixed at 8.11.0"
    test_runner_features: "allowed_warnings"
- do:
    cluster.put_component_template:
      name: "test-subobjects"
      body:
        template:
          mappings:
            subobjects: false
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- do:
    cluster.put_component_template:
      name: "test-field"
      body:
        template:
          mappings:
            properties:
              parent.subfield:
                type: "keyword"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- do:
    allowed_warnings:
    - "index template [test-composable-template] has index patterns [test-*] matching\
      \ patterns from existing older templates [global] with patterns (global => [*]);\
      \ this template [test-composable-template] will take precedence during new index\
      \ creation"
    indices.put_index_template:
      name: "test-composable-template"
      body:
        index_patterns:
        - "test-*"
        composed_of:
        - "test-subobjects"
        - "test-field"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- is_true: "acknowledged"
- do:
    indices.create:
      index: "test-generic"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- do:
    indices.get_mapping:
      index: "test-generic"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- match:
    test-generic.mappings.properties.parent\.subfield.type: "keyword"
---
'Composable index templates that include subobjects: false on arbitrary field':
- requires:
    cluster_features: "gte_v8.11.0"
    reason: "https://github.com/elastic/elasticsearch/issues/96768 fixed at 8.11.0"
    test_runner_features: "allowed_warnings"
- do:
    cluster.put_component_template:
      name: "test-subobjects"
      body:
        template:
          mappings:
            properties:
              parent:
                type: "object"
                subobjects: false
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- do:
    cluster.put_component_template:
      name: "test-subfield"
      body:
        template:
          mappings:
            properties:
              parent:
                properties:
                  child.grandchild:
                    type: "keyword"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- do:
    allowed_warnings:
    - "index template [test-composable-template] has index patterns [test-*] matching\
      \ patterns from existing older templates [global] with patterns (global => [*]);\
      \ this template [test-composable-template] will take precedence during new index\
      \ creation"
    indices.put_index_template:
      name: "test-composable-template"
      body:
        index_patterns:
        - "test-*"
        composed_of:
        - "test-subobjects"
        - "test-subfield"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- is_true: "acknowledged"
- do:
    indices.create:
      index: "test-generic"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- do:
    indices.get_mapping:
      index: "test-generic"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- match:
    test-generic.mappings.properties.parent.properties.child\.grandchild.type: "keyword"
---
Composition of component templates with different legal field mappings:
- skip:
    features: "allowed_warnings"
- do:
    cluster.put_component_template:
      name: "mapping"
      body:
        template:
          mappings:
            properties:
              field:
                type: "long"
                coerce: true
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- do:
    allowed_warnings:
    - "index template [test-composable-template] has index patterns [test-*] matching\
      \ patterns from existing older templates [global] with patterns (global => [*]);\
      \ this template [test-composable-template] will take precedence during new index\
      \ creation"
    indices.put_index_template:
      name: "test-composable-template"
      body:
        index_patterns:
        - "test-*"
        composed_of:
        - "mapping"
        template:
          mappings:
            properties:
              field:
                type: "keyword"
                ignore_above: 1024
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- is_true: "acknowledged"
- do:
    indices.create:
      index: "test-generic"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- do:
    indices.get_mapping:
      index: "test-generic"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- match:
    test-generic.mappings.properties.field.type: "keyword"
- match:
    test-generic.mappings.properties.field.ignore_above: 1024
---
Using deprecated component templates and pipelines in index template:
- requires:
    cluster_features: "gte_v8.12.0"
    reason: "The deprecated flags have been introduced in 8.12.0"
    test_runner_features: "allowed_warnings"
- do:
    cluster.put_component_template:
      name: "mapping"
      body:
        template:
          mappings:
            properties:
              field:
                type: "long"
        deprecated: true
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- do:
    ingest.put_pipeline:
      id: "my_deprecated_pipeline"
      body:
        deprecated: true
        processors: []
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- match:
    acknowledged: true
- do:
    cluster.put_component_template:
      name: "setting"
      body:
        template:
          settings:
            index:
              default_pipeline: "my_deprecated_pipeline"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- do:
    allowed_warnings:
    - "index template [test-composable-template] has index patterns [test-*] matching\
      \ patterns from existing older templates [global] with patterns (global => [*]);\
      \ this template [test-composable-template] will take precedence during new index\
      \ creation"
    - "index template [test-composable-template] uses deprecated component template\
      \ [mapping]"
    - "index template [test-composable-template] uses deprecated ingest pipeline [my_deprecated_pipeline]"
    indices.put_index_template:
      name: "test-composable-template"
      body:
        index_patterns:
        - "test-*"
        composed_of:
        - "mapping"
        - "setting"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- is_true: "acknowledged"
