<commit_before># Integration tests for Mapper Annotated_text components
#

---
"annotated highlighter on annotated text":
  - skip:
      version: " - 6.99.99"
      reason: Annotated text type introduced in 7.0.0-alpha1

  - do:
      indices.create:
        index: annotated
        body:
          settings:
            number_of_shards: "1"
            number_of_replicas: "0"
          mappings:
            doc:
              properties:
                text:
                  type: annotated_text
                entityID:
                  type: keyword

  - do:
      index:
        index: annotated
        type: doc
        body: 
            "text" : "The [quick brown fox](entity_3789) is brown."
            "entityID": "entity_3789"
        refresh: true

  - do:
      search:
        body: { "query" : {"term" : { "entityID" : "entity_3789" } }, "highlight" : { "type" : "annotated", "require_field_match": false, "fields" : { "text" : {} } } }

  - match: {hits.hits.0.highlight.text.0: "The [quick brown fox](_hit_term=entity_3789&entity_3789) is brown."}

  - do:
      search:
        body: { "query" : {"term" : { "text" : "quick" } }, "highlight" : { "type" : "annotated", "require_field_match": false, "fields" : { "text" : {} } } }

  - match: {hits.hits.0.highlight.text.0: "The [quick](_hit_term=quick) brown fox is brown."}
<commit_msg>Fix for test version following backport of annotated_text plugin (#33979)<commit_after># Integration tests for Mapper Annotated_text components
#

---
"annotated highlighter on annotated text":
  - skip:
      version: " - 6.4.99"
      reason: Annotated text type introduced in 6.5.0

  - do:
      indices.create:
        index: annotated
        body:
          settings:
            number_of_shards: "1"
            number_of_replicas: "0"
          mappings:
            doc:
              properties:
                text:
                  type: annotated_text
                entityID:
                  type: keyword

  - do:
      index:
        index: annotated
        type: doc
        body: 
            "text" : "The [quick brown fox](entity_3789) is brown."
            "entityID": "entity_3789"
        refresh: true

  - do:
      search:
        body: { "query" : {"term" : { "entityID" : "entity_3789" } }, "highlight" : { "type" : "annotated", "require_field_match": false, "fields" : { "text" : {} } } }

  - match: {hits.hits.0.highlight.text.0: "The [quick brown fox](_hit_term=entity_3789&entity_3789) is brown."}

  - do:
      search:
        body: { "query" : {"term" : { "text" : "quick" } }, "highlight" : { "type" : "annotated", "require_field_match": false, "fields" : { "text" : {} } } }

  - match: {hits.hits.0.highlight.text.0: "The [quick](_hit_term=quick) brown fox is brown."}

{'fraction_non_alphanumeric': 0.14162473040977713, 'fraction_numerical': 0.026240115025161753, 'mean_word_length': 1.9764705882352942, 'pattern_counts': {'":': 8, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '6992930', 'n_tokens_mistral': 978, 'n_tokens_neox': 889, 'n_words': 215}