OpenSearch/rest-api-spec/test/search/test_sig_terms.yaml
Britta Weber 1cbeaf6c45 significant terms: fix json response
Commit fbd7c9aa5d6c1c introduced a regression that caused
the min_doc_count to be equal to the number of documents in the
background set. As a result no buckets were built when the
response for significant terms was created.
This only affected the final XContent response.

closes #6535
2014-06-18 18:51:34 +02:00

75 lines
1.6 KiB
YAML

---
"Default index":
- do:
indices.create:
index: goodbad
body:
settings:
number_of_shards: "1"
- do:
index:
index: goodbad
type: doc
id: 1
body: { text: "good", class: "good" }
- do:
index:
index: goodbad
type: doc
id: 2
body: { text: "good", class: "good" }
- do:
index:
index: goodbad
type: doc
id: 3
body: { text: "bad", class: "bad" }
- do:
index:
index: goodbad
type: doc
id: 4
body: { text: "bad", class: "bad" }
- do:
index:
index: goodbad
type: doc
id: 5
body: { text: "good bad", class: "good" }
- do:
index:
index: goodbad
type: doc
id: 6
body: { text: "good bad", class: "bad" }
- do:
index:
index: goodbad
type: doc
id: 7
body: { text: "bad", class: "bad" }
- do:
indices.refresh:
index: [goodbad]
- do:
search:
index: goodbad
type: doc
- match: {hits.total: 7}
- do:
search:
index: goodbad
type: doc
body: {"aggs": {"class": {"terms": {"field": "class"},"aggs": {"sig_terms": {"significant_terms": {"field": "text"}}}}}}
- match: {aggregations.class.buckets.0.sig_terms.buckets.0.key: "bad"}
- match: {aggregations.class.buckets.1.sig_terms.buckets.0.key: "good"}