|
@@ -0,0 +1,210 @@
|
|
|
+setup:
|
|
|
+ - do:
|
|
|
+ indices.create:
|
|
|
+ index: test
|
|
|
+ body:
|
|
|
+ settings:
|
|
|
+ number_of_replicas: 0
|
|
|
+ mappings:
|
|
|
+ properties:
|
|
|
+ full_text:
|
|
|
+ type: text
|
|
|
+ analyzer: standard
|
|
|
+ fields:
|
|
|
+ eng:
|
|
|
+ type: text
|
|
|
+ store: true
|
|
|
+ analyzer: stop
|
|
|
+
|
|
|
+ - do:
|
|
|
+ bulk:
|
|
|
+ index: test
|
|
|
+ refresh: true
|
|
|
+ body:
|
|
|
+ - { "index": {} }
|
|
|
+ - { "full_text": "the apple a banana a pear the melon" }
|
|
|
+ - { "index": {} }
|
|
|
+ - { "full_text": "an apple a banana the pear" }
|
|
|
+ - { "index": { } }
|
|
|
+ - { "full_text": "the apple the banana the melon" }
|
|
|
+ - { "index": { } }
|
|
|
+ - { "full_text": "an apple a pear a melon" }
|
|
|
+ - { "index": { } }
|
|
|
+ - { "full_text": "an apple a melon" }
|
|
|
+ - { "index": { } }
|
|
|
+ - { "full_text": "elma muz armut kavun" }
|
|
|
+ - { "index": { } }
|
|
|
+ - { "full_text": "elma muz armut" }
|
|
|
+ - { "index": { } }
|
|
|
+ - { "full_text": "elma armut kavun" }
|
|
|
+
|
|
|
+
|
|
|
+---
|
|
|
+"significant_texts all terms":
|
|
|
+ - skip:
|
|
|
+ version: " - 8.1.99"
|
|
|
+ reason: bug fixed in 8.2.0
|
|
|
+ - do:
|
|
|
+ search:
|
|
|
+ body:
|
|
|
+ query:
|
|
|
+ match_all: {}
|
|
|
+ size: 0
|
|
|
+ aggs:
|
|
|
+ significant_texts:
|
|
|
+ sampler:
|
|
|
+ shard_size: 7
|
|
|
+ aggs:
|
|
|
+ keywords:
|
|
|
+ significant_text:
|
|
|
+ field: full_text.eng
|
|
|
+
|
|
|
+ - match: { hits.total.value: 8 }
|
|
|
+ - match: { hits.total.relation: "eq" }
|
|
|
+ - length: { aggregations.significant_texts.keywords.buckets: 4 }
|
|
|
+ - match: { aggregations.significant_texts.keywords.doc_count: 7 }
|
|
|
+ - match: { aggregations.significant_texts.keywords.bg_count: 8 }
|
|
|
+ - match: { aggregations.significant_texts.keywords.buckets.0.key: "apple" }
|
|
|
+ - match: { aggregations.significant_texts.keywords.buckets.0.doc_count: 5 }
|
|
|
+ - match: { aggregations.significant_texts.keywords.buckets.0.bg_count: 5 }
|
|
|
+ - match: { aggregations.significant_texts.keywords.buckets.1.key: "melon" }
|
|
|
+ - match: { aggregations.significant_texts.keywords.buckets.1.doc_count: 4 }
|
|
|
+ - match: { aggregations.significant_texts.keywords.buckets.1.bg_count: 4 }
|
|
|
+ - match: { aggregations.significant_texts.keywords.buckets.2.key: "pear" }
|
|
|
+ - match: { aggregations.significant_texts.keywords.buckets.2.doc_count: 3 }
|
|
|
+ - match: { aggregations.significant_texts.keywords.buckets.2.bg_count: 3 }
|
|
|
+ - match: { aggregations.significant_texts.keywords.buckets.3.key: "banana" }
|
|
|
+ - match: { aggregations.significant_texts.keywords.buckets.3.doc_count: 3 }
|
|
|
+ - match: { aggregations.significant_texts.keywords.buckets.3.bg_count: 3 }
|
|
|
+
|
|
|
+---
|
|
|
+"significant_texts limited size":
|
|
|
+ - skip:
|
|
|
+ version: " - 8.1.99"
|
|
|
+ reason: bug fixed in 8.2.0
|
|
|
+ - do:
|
|
|
+ search:
|
|
|
+ body:
|
|
|
+ query:
|
|
|
+ match_all: {}
|
|
|
+ size: 0
|
|
|
+ aggs:
|
|
|
+ significant_texts:
|
|
|
+ sampler:
|
|
|
+ shard_size: 7
|
|
|
+ aggs:
|
|
|
+ keywords:
|
|
|
+ significant_text:
|
|
|
+ field: full_text.eng
|
|
|
+ size: 2
|
|
|
+
|
|
|
+ - match: { hits.total.value: 8 }
|
|
|
+ - match: { hits.total.relation: "eq" }
|
|
|
+ - length: { aggregations.significant_texts.keywords.buckets: 2 }
|
|
|
+ - match: { aggregations.significant_texts.keywords.doc_count: 7 }
|
|
|
+ - match: { aggregations.significant_texts.keywords.bg_count: 8 }
|
|
|
+ - match: { aggregations.significant_texts.keywords.buckets.0.key: "apple" }
|
|
|
+ - match: { aggregations.significant_texts.keywords.buckets.0.doc_count: 5 }
|
|
|
+ - match: { aggregations.significant_texts.keywords.buckets.0.bg_count: 5 }
|
|
|
+ - match: { aggregations.significant_texts.keywords.buckets.1.key: "melon" }
|
|
|
+ - match: { aggregations.significant_texts.keywords.buckets.1.doc_count: 4 }
|
|
|
+ - match: { aggregations.significant_texts.keywords.buckets.1.bg_count: 4 }
|
|
|
+
|
|
|
+---
|
|
|
+"significant_texts with min_doc_count":
|
|
|
+ - skip:
|
|
|
+ version: " - 8.1.99"
|
|
|
+ reason: bug fixed in 8.2.0
|
|
|
+ - do:
|
|
|
+ search:
|
|
|
+ body:
|
|
|
+ query:
|
|
|
+ match_all: {}
|
|
|
+ size: 0
|
|
|
+ aggs:
|
|
|
+ significant_texts:
|
|
|
+ sampler:
|
|
|
+ shard_size: 7
|
|
|
+ aggs:
|
|
|
+ keywords:
|
|
|
+ significant_text:
|
|
|
+ field: full_text.eng
|
|
|
+ min_doc_count: 5
|
|
|
+
|
|
|
+ - match: { hits.total.value: 8 }
|
|
|
+ - match: { hits.total.relation: "eq" }
|
|
|
+ - length: { aggregations.significant_texts.keywords.buckets: 1 }
|
|
|
+ - match: { aggregations.significant_texts.keywords.doc_count: 7 }
|
|
|
+ - match: { aggregations.significant_texts.keywords.bg_count: 8 }
|
|
|
+ - match: { aggregations.significant_texts.keywords.buckets.0.key: "apple" }
|
|
|
+ - match: { aggregations.significant_texts.keywords.buckets.0.doc_count: 5 }
|
|
|
+ - match: { aggregations.significant_texts.keywords.buckets.0.bg_count: 5 }
|
|
|
+
|
|
|
+---
|
|
|
+"significant_texts with exclude":
|
|
|
+ - skip:
|
|
|
+ version: " - 8.1.99"
|
|
|
+ reason: bug fixed in 8.2.0
|
|
|
+ - do:
|
|
|
+ search:
|
|
|
+ body:
|
|
|
+ query:
|
|
|
+ match_all: {}
|
|
|
+ size: 0
|
|
|
+ aggs:
|
|
|
+ significant_texts:
|
|
|
+ sampler:
|
|
|
+ shard_size: 7
|
|
|
+ aggs:
|
|
|
+ keywords:
|
|
|
+ significant_text:
|
|
|
+ field: full_text.eng
|
|
|
+ exclude: "app.*"
|
|
|
+
|
|
|
+ - match: { hits.total.value: 8 }
|
|
|
+ - match: { hits.total.relation: "eq" }
|
|
|
+ - length: { aggregations.significant_texts.keywords.buckets: 3 }
|
|
|
+ - match: { aggregations.significant_texts.keywords.doc_count: 7 }
|
|
|
+ - match: { aggregations.significant_texts.keywords.bg_count: 8 }
|
|
|
+ - match: { aggregations.significant_texts.keywords.buckets.0.key: "melon" }
|
|
|
+ - match: { aggregations.significant_texts.keywords.buckets.0.doc_count: 4 }
|
|
|
+ - match: { aggregations.significant_texts.keywords.buckets.0.bg_count: 4 }
|
|
|
+ - match: { aggregations.significant_texts.keywords.buckets.1.key: "pear" }
|
|
|
+ - match: { aggregations.significant_texts.keywords.buckets.1.doc_count: 3 }
|
|
|
+ - match: { aggregations.significant_texts.keywords.buckets.1.bg_count: 3 }
|
|
|
+ - match: { aggregations.significant_texts.keywords.buckets.2.key: "banana" }
|
|
|
+ - match: { aggregations.significant_texts.keywords.buckets.2.doc_count: 3 }
|
|
|
+ - match: { aggregations.significant_texts.keywords.buckets.2.bg_count: 3 }
|
|
|
+
|
|
|
+---
|
|
|
+"significant_texts with include":
|
|
|
+ - skip:
|
|
|
+ version: " - 8.1.99"
|
|
|
+ reason: bug fixed in 8.2.0
|
|
|
+ - do:
|
|
|
+ search:
|
|
|
+ body:
|
|
|
+ query:
|
|
|
+ match_all: {}
|
|
|
+ size: 0
|
|
|
+ aggs:
|
|
|
+ significant_texts:
|
|
|
+ sampler:
|
|
|
+ shard_size: 7
|
|
|
+ aggs:
|
|
|
+ keywords:
|
|
|
+ significant_text:
|
|
|
+ field: full_text.eng
|
|
|
+ include: ["melon", "banana"]
|
|
|
+
|
|
|
+ - match: { hits.total.value: 8 }
|
|
|
+ - match: { hits.total.relation: "eq" }
|
|
|
+ - length: { aggregations.significant_texts.keywords.buckets: 2 }
|
|
|
+ - match: { aggregations.significant_texts.keywords.doc_count: 7 }
|
|
|
+ - match: { aggregations.significant_texts.keywords.bg_count: 8 }
|
|
|
+ - match: { aggregations.significant_texts.keywords.buckets.0.key: "melon" }
|
|
|
+ - match: { aggregations.significant_texts.keywords.buckets.0.doc_count: 4 }
|
|
|
+ - match: { aggregations.significant_texts.keywords.buckets.0.bg_count: 4 }
|
|
|
+ - match: { aggregations.significant_texts.keywords.buckets.1.key: "banana" }
|
|
|
+ - match: { aggregations.significant_texts.keywords.buckets.1.doc_count: 3 }
|
|
|
+ - match: { aggregations.significant_texts.keywords.buckets.1.bg_count: 3 }
|