<commit_before>setup:

  - do:
      indices.create:
          index: testidx
          body:
            mappings:
              properties:
                text:
                  type :         "text"
                  term_vector :  "with_positions_offsets"
  - do:
      index:
        index: testidx
        id:    testing_document
        body:  {"text" : "The quick brown fox is brown."}

  - do:
      indices.refresh: {}

---
"Basic tests for multi termvector get":

  - do:
        mtermvectors:
          "term_statistics" : true
          "body" :
            "docs":
              -
                  "_index" : "testidx"
                  "_id" : "testing_document"

  - match: {docs.0.term_vectors.text.terms.brown.term_freq: 2}
  - match: {docs.0.term_vectors.text.terms.brown.ttf: 2}

  - do:
        mtermvectors:
          "term_statistics" : true
          "index" : "testidx"
          "body" :
            "docs":
              -
                  "_id" : "testing_document"

  - match: {docs.0.term_vectors.text.terms.brown.term_freq: 2}
  - match: {docs.0.term_vectors.text.terms.brown.ttf: 2}

  - do:
        mtermvectors:
          "term_statistics" : true
          "index" : "testidx"
          "ids" : ["testing_document"]

  - match: {docs.0.term_vectors.text.terms.brown.term_freq: 2}
  - match: {docs.0.term_vectors.text.terms.brown.ttf: 2}

---
"Tests index not found error in item":

  - do:
        mtermvectors:
          "term_statistics" : true
          "body" :
            "docs":
              -
                 "_id" : "testing_document"
                 "_index" : "testidx"
              -
                 "_id" : "testing_document"
                 "_index" : "wrong_idx"

  - match: {docs.0.term_vectors.text.terms.brown.term_freq: 2}
  - match: {docs.0.term_vectors.text.terms.brown.ttf: 2}
  - match: {docs.1.error.type: "index_not_found_exception"}
  - match: {docs.1.error.reason: "no such index [wrong_idx]"}

---
"Tests catching other exceptions per item":
  - skip:
      version: "all"
      reason: "Awaits fix: https://github.com/elastic/elasticsearch/issues/65385"

  - do:
      indices.create:
          index: testidx2

  - do:
      indices.put_alias:
        index: testidx
        name: test_alias

  - do:
      indices.put_alias:
        index: testidx2
        name: test_alias

  - do:
        mtermvectors:
          "term_statistics" : true
          "body" :
            "docs":
              -
                 "_id" : "testing_document"
                 "_index" : "testidx"
              -
                 "_id" : "testing_document"
                 "_index" : "test_alias"

  - match: {docs.0.term_vectors.text.terms.brown.term_freq: 2}
  - match: {docs.0.term_vectors.text.terms.brown.ttf: 2}
  - match: {docs.1.error.type: "illegal_argument_exception"}
  - match: {docs.1.error.reason: "/Alias.\\[test_alias\\].has.more.than.one.index.associated.with.it.\\[\\[testidx2?,.testidx2?\\]\\].*/"}


<commit_msg>Reactivate deactivated integration test (#65388)<commit_after>setup:

  - do:
      indices.create:
          index: testidx
          body:
            mappings:
              properties:
                text:
                  type :         "text"
                  term_vector :  "with_positions_offsets"
  - do:
      index:
        index: testidx
        id:    testing_document
        body:  {"text" : "The quick brown fox is brown."}

  - do:
      indices.refresh: {}

---
"Basic tests for multi termvector get":

  - do:
        mtermvectors:
          "term_statistics" : true
          "body" :
            "docs":
              -
                  "_index" : "testidx"
                  "_id" : "testing_document"

  - match: {docs.0.term_vectors.text.terms.brown.term_freq: 2}
  - match: {docs.0.term_vectors.text.terms.brown.ttf: 2}

  - do:
        mtermvectors:
          "term_statistics" : true
          "index" : "testidx"
          "body" :
            "docs":
              -
                  "_id" : "testing_document"

  - match: {docs.0.term_vectors.text.terms.brown.term_freq: 2}
  - match: {docs.0.term_vectors.text.terms.brown.ttf: 2}

  - do:
        mtermvectors:
          "term_statistics" : true
          "index" : "testidx"
          "ids" : ["testing_document"]

  - match: {docs.0.term_vectors.text.terms.brown.term_freq: 2}
  - match: {docs.0.term_vectors.text.terms.brown.ttf: 2}

---
"Tests index not found error in item":

  - do:
        mtermvectors:
          "term_statistics" : true
          "body" :
            "docs":
              -
                 "_id" : "testing_document"
                 "_index" : "testidx"
              -
                 "_id" : "testing_document"
                 "_index" : "wrong_idx"

  - match: {docs.0.term_vectors.text.terms.brown.term_freq: 2}
  - match: {docs.0.term_vectors.text.terms.brown.ttf: 2}
  - match: {docs.1.error.type: "index_not_found_exception"}
  - match: {docs.1.error.reason: "no such index [wrong_idx]"}

---
"Tests catching other exceptions per item":

  - do:
      indices.create:
          index: testidx2

  - do:
      indices.put_alias:
        index: testidx
        name: test_alias

  - do:
      indices.put_alias:
        index: testidx2
        name: test_alias

  - do:
        mtermvectors:
          "term_statistics" : true
          "body" :
            "docs":
              -
                 "_id" : "testing_document"
                 "_index" : "testidx"
              -
                 "_id" : "testing_document"
                 "_index" : "test_alias"

  - match: {docs.0.term_vectors.text.terms.brown.term_freq: 2}
  - match: {docs.0.term_vectors.text.terms.brown.ttf: 2}
  - match: {docs.1.error.type: "illegal_argument_exception"}
  - match: {docs.1.error.reason: "/Alias.\\[test_alias\\].has.more.than.one.index.associated.with.it.\\[\\[testidx2?,.testidx2?\\]\\].*/"}



{'fraction_non_alphanumeric': 0.1369955917260088, 'fraction_numerical': 0.011190233977619531, 'mean_word_length': 1.5592190889370934, 'pattern_counts': {'":': 14, '<': 3, '<?xml version=': 0, '>': 3, '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': '1091809', 'n_tokens_mistral': 2060, 'n_tokens_neox': 1901, 'n_words': 341}