rest-api-spec.test.search.highlight.10_unified.yml Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rest-api-spec Show documentation
Show all versions of rest-api-spec Show documentation
OpenSearch subproject :rest-api-spec
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