All Downloads are FREE. Search and download functionalities are using the official Maven repository.

rest-api-spec.test.search.highlight.10_unified.yml Maven / Gradle / Ivy

There is a newer version: 2.18.0
Show newest version
setup:
  - do:
      indices.create:
          index: test
          body:
            mappings:
              "properties":
                "text":
                   "type": "text"
                   "fields":
                      "fvh":
                        "type": "text"
                        "term_vector": "with_positions_offsets"
                      "postings":
                        "type": "text"
                        "index_options": "offsets"
  - do:
      index:
        index: test
        id:    1
        body:
            "text" : "The quick brown fox is brown."
  - do:
      indices.refresh: {}

---
"Basic":
  - do:
      search:
        rest_total_hits_as_int: true
        body: { "query" : {"multi_match" : { "query" : "quick brown fox", "fields" : [ "text*"] } }, "highlight" : { "type" : "unified", "fields" : { "*" : {} } } }

  - match: {hits.hits.0.highlight.text.0: "The quick brown fox is brown."}
  - match: {hits.hits.0.highlight.text\.fvh.0: "The quick brown fox is brown."}
  - match: {hits.hits.0.highlight.text\.postings.0: "The quick brown fox is brown."}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy