summaryrefslogtreecommitdiffstats
path: root/tests/files
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2020-08-24 13:42:30 -0700
committerBryan Newbold <bnewbold@archive.org>2020-08-24 13:42:30 -0700
commit95fca87e9f5fae3283ade00363bfd2d094dd0689 (patch)
tree3c1392544000d6b39da9d7637898f7ab5418c7b1 /tests/files
parentbb552c9d0060cf49e187d1b06460a838ef19828d (diff)
downloades-public-proxy-95fca87e9f5fae3283ade00363bfd2d094dd0689.tar.gz
es-public-proxy-95fca87e9f5fae3283ade00363bfd2d094dd0689.zip
more test queries
Diffstat (limited to 'tests/files')
-rw-r--r--tests/files/DELETE_scroll_body.txt4
-rw-r--r--tests/files/DELETE_scroll_path.txt1
-rw-r--r--tests/files/GET_collapse_expand.txt24
-rw-r--r--tests/files/GET_collapse_nested.txt16
-rw-r--r--tests/files/GET_highlight.txt16
-rw-r--r--tests/files/GET_highlight_complex.txt16
-rw-r--r--tests/files/GET_highlight_fields.txt18
-rw-r--r--tests/files/GET_highlight_query.txt55
-rw-r--r--tests/files/GET_search_bool.txt15
-rw-r--r--tests/files/GET_search_boosting.txt18
-rw-r--r--tests/files/GET_search_docvalues.txt16
-rw-r--r--tests/files/GET_search_sort.txt13
-rw-r--r--tests/files/POST_scroll_continue.txt5
-rw-r--r--tests/files/POST_search_inner.txt17
-rw-r--r--tests/files/POST_search_rescore.txt26
-rw-r--r--tests/files/POST_search_sort_mode.txt9
-rw-r--r--tests/files/POST_search_start_scroll.txt9
17 files changed, 278 insertions, 0 deletions
diff --git a/tests/files/DELETE_scroll_body.txt b/tests/files/DELETE_scroll_body.txt
new file mode 100644
index 0000000..26960a9
--- /dev/null
+++ b/tests/files/DELETE_scroll_body.txt
@@ -0,0 +1,4 @@
+DELETE /_search/scroll
+{
+ "scroll_id" : "DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ=="
+}
diff --git a/tests/files/DELETE_scroll_path.txt b/tests/files/DELETE_scroll_path.txt
new file mode 100644
index 0000000..7910ed8
--- /dev/null
+++ b/tests/files/DELETE_scroll_path.txt
@@ -0,0 +1 @@
+DELETE /_search/scroll/DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==
diff --git a/tests/files/GET_collapse_expand.txt b/tests/files/GET_collapse_expand.txt
new file mode 100644
index 0000000..dc6b1a8
--- /dev/null
+++ b/tests/files/GET_collapse_expand.txt
@@ -0,0 +1,24 @@
+GET /my-index-000001/_search
+{
+ "query": {
+ "match": {
+ "message": "GET /search"
+ }
+ },
+ "collapse": {
+ "field": "user.id",
+ "inner_hits": [
+ {
+ "name": "largest_responses",
+ "size": 3,
+ "sort": [ "http.response.bytes" ]
+ },
+ {
+ "name": "most_recent",
+ "size": 3,
+ "sort": [ { "@timestamp": "asc" } ]
+ }
+ ]
+ },
+ "sort": [ "http.response.bytes" ]
+}
diff --git a/tests/files/GET_collapse_nested.txt b/tests/files/GET_collapse_nested.txt
new file mode 100644
index 0000000..a31c8e4
--- /dev/null
+++ b/tests/files/GET_collapse_nested.txt
@@ -0,0 +1,16 @@
+GET /my-index-000001/_search
+{
+ "query": {
+ "match": {
+ "message": "GET /search"
+ }
+ },
+ "collapse": {
+ "field": "geo.country_name",
+ "inner_hits": {
+ "name": "by_location",
+ "collapse": { "field": "user.id" },
+ "size": 3
+ }
+ }
+}
diff --git a/tests/files/GET_highlight.txt b/tests/files/GET_highlight.txt
new file mode 100644
index 0000000..15346fb
--- /dev/null
+++ b/tests/files/GET_highlight.txt
@@ -0,0 +1,16 @@
+GET my-index-000001/_search
+{
+ "query": {
+ "match_phrase": { "message": "number 1" }
+ },
+ "highlight": {
+ "fields": {
+ "message": {
+ "type": "plain",
+ "fragment_size": 15,
+ "number_of_fragments": 3,
+ "fragmenter": "simple"
+ }
+ }
+ }
+}
diff --git a/tests/files/GET_highlight_complex.txt b/tests/files/GET_highlight_complex.txt
new file mode 100644
index 0000000..94e4221
--- /dev/null
+++ b/tests/files/GET_highlight_complex.txt
@@ -0,0 +1,16 @@
+GET /_search
+{
+ "query" : {
+ "match": { "user.id": "kimchy" }
+ },
+ "highlight" : {
+ "number_of_fragments" : 3,
+ "fragment_size" : 150,
+ "fields" : {
+ "body" : { "pre_tags" : ["<em>"], "post_tags" : ["</em>"] },
+ "blog.title" : { "number_of_fragments" : 0 },
+ "blog.author" : { "number_of_fragments" : 0 },
+ "blog.comment" : { "number_of_fragments" : 5, "order" : "score" }
+ }
+ }
+}
diff --git a/tests/files/GET_highlight_fields.txt b/tests/files/GET_highlight_fields.txt
new file mode 100644
index 0000000..bbd474a
--- /dev/null
+++ b/tests/files/GET_highlight_fields.txt
@@ -0,0 +1,18 @@
+GET /_search
+{
+ "query": {
+ "query_string": {
+ "query": "running scissors",
+ "fields": ["comment", "comment.plain^10"]
+ }
+ },
+ "highlight": {
+ "order": "score",
+ "fields": {
+ "comment": {
+ "matched_fields": ["comment", "comment.plain"],
+ "type" : "fvh"
+ }
+ }
+ }
+}
diff --git a/tests/files/GET_highlight_query.txt b/tests/files/GET_highlight_query.txt
new file mode 100644
index 0000000..2540b45
--- /dev/null
+++ b/tests/files/GET_highlight_query.txt
@@ -0,0 +1,55 @@
+GET /_search
+{
+ "query": {
+ "match": {
+ "comment": {
+ "query": "foo bar"
+ }
+ }
+ },
+ "rescore": {
+ "window_size": 50,
+ "query": {
+ "rescore_query": {
+ "match_phrase": {
+ "comment": {
+ "query": "foo bar",
+ "slop": 1
+ }
+ }
+ },
+ "rescore_query_weight": 10
+ }
+ },
+ "_source": false,
+ "highlight": {
+ "order": "score",
+ "fields": {
+ "comment": {
+ "fragment_size": 150,
+ "number_of_fragments": 3,
+ "highlight_query": {
+ "bool": {
+ "must": {
+ "match": {
+ "comment": {
+ "query": "foo bar"
+ }
+ }
+ },
+ "should": {
+ "match_phrase": {
+ "comment": {
+ "query": "foo bar",
+ "slop": 1,
+ "boost": 10.0
+ }
+ }
+ },
+ "minimum_should_match": 0
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/tests/files/GET_search_bool.txt b/tests/files/GET_search_bool.txt
new file mode 100644
index 0000000..f04ac5a
--- /dev/null
+++ b/tests/files/GET_search_bool.txt
@@ -0,0 +1,15 @@
+GET _search
+{
+ "query": {
+ "bool": {
+ "must": {
+ "match_all": {}
+ },
+ "filter": {
+ "term": {
+ "status": "active"
+ }
+ }
+ }
+ }
+}
diff --git a/tests/files/GET_search_boosting.txt b/tests/files/GET_search_boosting.txt
new file mode 100644
index 0000000..4db1814
--- /dev/null
+++ b/tests/files/GET_search_boosting.txt
@@ -0,0 +1,18 @@
+GET /_search
+{
+ "query": {
+ "boosting": {
+ "positive": {
+ "term": {
+ "text": "apple"
+ }
+ },
+ "negative": {
+ "term": {
+ "text": "pie tart fruit crumble tree"
+ }
+ },
+ "negative_boost": 0.5
+ }
+ }
+}
diff --git a/tests/files/GET_search_docvalues.txt b/tests/files/GET_search_docvalues.txt
new file mode 100644
index 0000000..5b92b39
--- /dev/null
+++ b/tests/files/GET_search_docvalues.txt
@@ -0,0 +1,16 @@
+GET /_search
+{
+ "query": {
+ "match_all": {}
+ },
+ "docvalue_fields": [
+ "my_ip*",
+ {
+ "field": "my_keyword_field"
+ },
+ {
+ "field": "*_date_field",
+ "format": "epoch_millis"
+ }
+ ]
+}
diff --git a/tests/files/GET_search_sort.txt b/tests/files/GET_search_sort.txt
new file mode 100644
index 0000000..9a0567c
--- /dev/null
+++ b/tests/files/GET_search_sort.txt
@@ -0,0 +1,13 @@
+GET /my-index-000001/_search
+{
+ "sort" : [
+ { "post_date" : {"order" : "asc"}},
+ "user",
+ { "name" : "desc" },
+ { "age" : "desc" },
+ "_score"
+ ],
+ "query" : {
+ "term" : { "user" : "kimchy" }
+ }
+}
diff --git a/tests/files/POST_scroll_continue.txt b/tests/files/POST_scroll_continue.txt
new file mode 100644
index 0000000..9aef4d3
--- /dev/null
+++ b/tests/files/POST_scroll_continue.txt
@@ -0,0 +1,5 @@
+POST /_search/scroll
+{
+ "scroll" : "1m",
+ "scroll_id" : "DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ=="
+}
diff --git a/tests/files/POST_search_inner.txt b/tests/files/POST_search_inner.txt
new file mode 100644
index 0000000..b6b3804
--- /dev/null
+++ b/tests/files/POST_search_inner.txt
@@ -0,0 +1,17 @@
+POST test/_search
+{
+ "query": {
+ "nested": {
+ "path": "comments",
+ "query": {
+ "match": { "comments.text": "words" }
+ },
+ "inner_hits": {
+ "_source": false,
+ "docvalue_fields": [
+ "comments.text.keyword"
+ ]
+ }
+ }
+ }
+}
diff --git a/tests/files/POST_search_rescore.txt b/tests/files/POST_search_rescore.txt
new file mode 100644
index 0000000..81fcd96
--- /dev/null
+++ b/tests/files/POST_search_rescore.txt
@@ -0,0 +1,26 @@
+POST /_search
+{
+ "query" : {
+ "match" : {
+ "message" : {
+ "operator" : "or",
+ "query" : "the quick brown"
+ }
+ }
+ },
+ "rescore" : {
+ "window_size" : 50,
+ "query" : {
+ "rescore_query" : {
+ "match_phrase" : {
+ "message" : {
+ "query" : "the quick brown",
+ "slop" : 2
+ }
+ }
+ },
+ "query_weight" : 0.7,
+ "rescore_query_weight" : 1.2
+ }
+ }
+}
diff --git a/tests/files/POST_search_sort_mode.txt b/tests/files/POST_search_sort_mode.txt
new file mode 100644
index 0000000..1d6988f
--- /dev/null
+++ b/tests/files/POST_search_sort_mode.txt
@@ -0,0 +1,9 @@
+POST /_search
+{
+ "query" : {
+ "term" : { "product" : "chocolate" }
+ },
+ "sort" : [
+ {"price" : {"order" : "asc", "mode" : "avg"}}
+ ]
+}
diff --git a/tests/files/POST_search_start_scroll.txt b/tests/files/POST_search_start_scroll.txt
new file mode 100644
index 0000000..8c8fd00
--- /dev/null
+++ b/tests/files/POST_search_start_scroll.txt
@@ -0,0 +1,9 @@
+POST /my-index-000001/_search?scroll=1m
+{
+ "size": 100,
+ "query": {
+ "match": {
+ "message": "foo"
+ }
+ }
+}