<commit_before>---
setup:
  - skip:
      version: " - 7.8.99"
      reason: "resolve index api only supported in 7.9+"
      features: allowed_warnings

  - do:
      allowed_warnings:
        - "index template [my-template1] has index patterns [simple-data-stream1] matching patterns from existing older templates [global] with patterns (global => [*]); this template [my-template1] will take precedence during new index creation"
      indices.put_index_template:
        name: my-template1
        body:
          index_patterns: [simple-data-stream1]
          data_stream: {}

  - do:
      allowed_warnings:
        - "index template [my-template2] has index patterns [simple-data-stream2] matching patterns from existing older templates [global] with patterns (global => [*]); this template [my-template2] will take precedence during new index creation"
      indices.put_index_template:
        name: my-template2
        body:
          index_patterns: [simple-data-stream2]
          data_stream: {}

  - do:
      indices.create_data_stream:
        name: simple-data-stream1

  - do:
      indices.create_data_stream:
        name: simple-data-stream2

  - do:
      indices.rollover:
        alias: "simple-data-stream2"

  - do:
      indices.create:
        index: test_index1
        body:
          aliases:
            test_alias: {}
            test_blias: {}
            test_clias: {}

  - do:
      indices.create:
        index: test_index2
        body:
          aliases:
            test_alias: {}

  - do:
      indices.close:
        index: test_index2

  - do:
      indices.create:
        index: test_index3
        body:
          aliases:
            test_blias: {}

---
"Resolve index with indices, aliases, and data streams":
  - skip:
      version: " - 7.8.99"
      reason: "resolve index api only supported in 7.9+"

  - do:
      indices.resolve_index:
        name: '*'

  - match: {indices.0.name: test_index1}
  - match: {indices.0.aliases.0: test_alias}
  - match: {indices.0.aliases.1: test_blias}
  - match: {indices.0.aliases.2: test_clias}
  - match: {indices.0.attributes.0: open}
  - match: {indices.1.name: test_index3}
  - match: {indices.1.aliases.0: test_blias}
  - match: {indices.1.attributes.0: open}
  - match: {aliases.0.name: test_alias}
  - match: {aliases.0.indices.0: test_index1}
  - match: {aliases.0.indices.1: test_index2}
  - match: {aliases.1.name: test_blias}
  - match: {aliases.1.indices.0: test_index1}
  - match: {aliases.1.indices.1: test_index3}
  - match: {aliases.2.name: test_clias}
  - match: {aliases.2.indices.0: test_index1}
  - match: {data_streams.0.name: simple-data-stream1}
  - match: {data_streams.0.backing_indices.0: .ds-simple-data-stream1-000001}
  - match: {data_streams.0.timestamp_field: "@timestamp"}
  - match: {data_streams.1.name: simple-data-stream2}
  - match: {data_streams.1.backing_indices.0: .ds-simple-data-stream2-000001}
  - match: {data_streams.1.backing_indices.1: .ds-simple-data-stream2-000002}
  - match: {data_streams.1.timestamp_field: "@timestamp"}

  - do:
      indices.delete_data_stream:
        name: simple-data-stream1
  - is_true: acknowledged

  - do:
      indices.delete_data_stream:
        name: simple-data-stream2
  - is_true: acknowledged

---
"Resolve index with hidden and closed indices":
  - skip:
      version: "all"
      reason: "AwaitsFix https://github.com/elastic/elasticsearch/issues/62190"

  - do:
      indices.resolve_index:
        name: '*'
        expand_wildcards: [all]

  - match: {indices.0.name: .ds-simple-data-stream1-000001}
  - match: {indices.0.attributes.0: hidden}
  - match: {indices.0.attributes.1: open}
  - match: {indices.0.data_stream: simple-data-stream1}
  - match: {indices.1.name: .ds-simple-data-stream2-000001}
  - match: {indices.1.attributes.0: hidden}
  - match: {indices.1.attributes.1: open}
  - match: {indices.1.data_stream: simple-data-stream2}
  - match: {indices.2.name: .ds-simple-data-stream2-000002}
  - match: {indices.2.attributes.0: hidden}
  - match: {indices.2.attributes.1: open}
  - match: {indices.2.data_stream: simple-data-stream2}
  - match: {indices.3.name: test_index1}
  - match: {indices.3.aliases.0: test_alias}
  - match: {indices.3.aliases.1: test_blias}
  - match: {indices.3.aliases.2: test_clias}
  - match: {indices.3.attributes.0: open}
  - match: {indices.4.name: test_index2}
  - match: {indices.4.aliases.0: test_alias}
  - match: {indices.4.attributes.0: closed}
  - match: {indices.5.name: test_index3}
  - match: {indices.5.aliases.0: test_blias}
  - match: {indices.5.attributes.0: open}
  - match: {aliases.0.name: test_alias}
  - match: {aliases.0.indices.0: test_index1}
  - match: {aliases.0.indices.1: test_index2}
  - match: {aliases.1.name: test_blias}
  - match: {aliases.1.indices.0: test_index1}
  - match: {aliases.1.indices.1: test_index3}
  - match: {aliases.2.name: test_clias}
  - match: {aliases.2.indices.0: test_index1}
  - match: {data_streams.0.name: simple-data-stream1}
  - match: {data_streams.0.backing_indices.0: .ds-simple-data-stream1-000001}
  - match: {data_streams.0.timestamp_field: "@timestamp"}
  - match: {data_streams.1.name: simple-data-stream2}
  - match: {data_streams.1.backing_indices.0: .ds-simple-data-stream2-000001}
  - match: {data_streams.1.backing_indices.1: .ds-simple-data-stream2-000002}
  - match: {data_streams.1.timestamp_field: "@timestamp"}

  - do:
      indices.delete_data_stream:
        name: simple-data-stream1
  - is_true: acknowledged

  - do:
      indices.delete_data_stream:
        name: simple-data-stream2
  - is_true: acknowledged
<commit_msg>Fix resolve index data streams yaml test. (#62221)<commit_after>---
setup:
  - skip:
      version: " - 7.8.99"
      reason: "resolve index api only supported in 7.9+"
      features: allowed_warnings

  - do:
      allowed_warnings:
        - "index template [my-template1] has index patterns [simple-data-stream1] matching patterns from existing older templates [global] with patterns (global => [*]); this template [my-template1] will take precedence during new index creation"
      indices.put_index_template:
        name: my-template1
        body:
          index_patterns: [simple-data-stream1]
          data_stream: {}

  - do:
      allowed_warnings:
        - "index template [my-template2] has index patterns [simple-data-stream2] matching patterns from existing older templates [global] with patterns (global => [*]); this template [my-template2] will take precedence during new index creation"
      indices.put_index_template:
        name: my-template2
        body:
          index_patterns: [simple-data-stream2]
          data_stream: {}

  - do:
      indices.create_data_stream:
        name: simple-data-stream1

  - do:
      indices.create_data_stream:
        name: simple-data-stream2

  - do:
      indices.rollover:
        alias: "simple-data-stream2"

  - do:
      indices.create:
        index: test_index1
        body:
          aliases:
            test_alias: {}
            test_blias: {}
            test_clias: {}

  - do:
      indices.create:
        index: test_index2
        body:
          aliases:
            test_alias: {}

  - do:
      indices.close:
        index: test_index2

  - do:
      indices.create:
        index: test_index3
        body:
          aliases:
            test_blias: {}

---
"Resolve index with indices, aliases, and data streams":
  - skip:
      version: " - 7.8.99"
      reason: "resolve index api only supported in 7.9+"

  - do:
      indices.resolve_index:
        name: '*'

  - match: {indices.0.name: test_index1}
  - match: {indices.0.aliases.0: test_alias}
  - match: {indices.0.aliases.1: test_blias}
  - match: {indices.0.aliases.2: test_clias}
  - match: {indices.0.attributes.0: open}
  - match: {indices.1.name: test_index3}
  - match: {indices.1.aliases.0: test_blias}
  - match: {indices.1.attributes.0: open}
  - match: {aliases.0.name: test_alias}
  - match: {aliases.0.indices.0: test_index1}
  - match: {aliases.0.indices.1: test_index2}
  - match: {aliases.1.name: test_blias}
  - match: {aliases.1.indices.0: test_index1}
  - match: {aliases.1.indices.1: test_index3}
  - match: {aliases.2.name: test_clias}
  - match: {aliases.2.indices.0: test_index1}
  - match: {data_streams.0.name: simple-data-stream1}
  - match: {data_streams.0.backing_indices.0: .ds-simple-data-stream1-000001}
  - match: {data_streams.0.timestamp_field: "@timestamp"}
  - match: {data_streams.1.name: simple-data-stream2}
  - match: {data_streams.1.backing_indices.0: .ds-simple-data-stream2-000001}
  - match: {data_streams.1.backing_indices.1: .ds-simple-data-stream2-000002}
  - match: {data_streams.1.timestamp_field: "@timestamp"}

  - do:
      indices.delete_data_stream:
        name: simple-data-stream1
  - is_true: acknowledged

  - do:
      indices.delete_data_stream:
        name: simple-data-stream2
  - is_true: acknowledged

---
"Resolve index with hidden and closed indices":
  - skip:
      version: " - 7.8.99"
      reason: "resolve index api only supported in 7.9+"

  - do:
      indices.resolve_index:
        name: ['*','-.ml*']
        expand_wildcards: [all]

  - match: {indices.0.name: .ds-simple-data-stream1-000001}
  - match: {indices.0.attributes.0: hidden}
  - match: {indices.0.attributes.1: open}
  - match: {indices.0.data_stream: simple-data-stream1}
  - match: {indices.1.name: .ds-simple-data-stream2-000001}
  - match: {indices.1.attributes.0: hidden}
  - match: {indices.1.attributes.1: open}
  - match: {indices.1.data_stream: simple-data-stream2}
  - match: {indices.2.name: .ds-simple-data-stream2-000002}
  - match: {indices.2.attributes.0: hidden}
  - match: {indices.2.attributes.1: open}
  - match: {indices.2.data_stream: simple-data-stream2}
  - match: {indices.3.name: test_index1}
  - match: {indices.3.aliases.0: test_alias}
  - match: {indices.3.aliases.1: test_blias}
  - match: {indices.3.aliases.2: test_clias}
  - match: {indices.3.attributes.0: open}
  - match: {indices.4.name: test_index2}
  - match: {indices.4.aliases.0: test_alias}
  - match: {indices.4.attributes.0: closed}
  - match: {indices.5.name: test_index3}
  - match: {indices.5.aliases.0: test_blias}
  - match: {indices.5.attributes.0: open}
  - match: {aliases.0.name: test_alias}
  - match: {aliases.0.indices.0: test_index1}
  - match: {aliases.0.indices.1: test_index2}
  - match: {aliases.1.name: test_blias}
  - match: {aliases.1.indices.0: test_index1}
  - match: {aliases.1.indices.1: test_index3}
  - match: {aliases.2.name: test_clias}
  - match: {aliases.2.indices.0: test_index1}
  - match: {data_streams.0.name: simple-data-stream1}
  - match: {data_streams.0.backing_indices.0: .ds-simple-data-stream1-000001}
  - match: {data_streams.0.timestamp_field: "@timestamp"}
  - match: {data_streams.1.name: simple-data-stream2}
  - match: {data_streams.1.backing_indices.0: .ds-simple-data-stream2-000001}
  - match: {data_streams.1.backing_indices.1: .ds-simple-data-stream2-000002}
  - match: {data_streams.1.timestamp_field: "@timestamp"}

  - do:
      indices.delete_data_stream:
        name: simple-data-stream1
  - is_true: acknowledged

  - do:
      indices.delete_data_stream:
        name: simple-data-stream2
  - is_true: acknowledged

{'fraction_non_alphanumeric': 0.1415294742432289, 'fraction_numerical': 0.039476013453708624, 'mean_word_length': 2.7751419979953225, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6102089', 'n_tokens_mistral': 4204, 'n_tokens_neox': 4052, 'n_words': 759}