Adding upstream version 2.5.1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
c71cb8b61d
commit
982828099e
783 changed files with 150650 additions and 0 deletions
3
test/tests/alias/datasets/shard0/a.json
Normal file
3
test/tests/alias/datasets/shard0/a.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"name": "a"
|
||||
}
|
3
test/tests/alias/datasets/shard0/c.json
Normal file
3
test/tests/alias/datasets/shard0/c.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"name": "c"
|
||||
}
|
3
test/tests/alias/datasets/shard1/b.json
Normal file
3
test/tests/alias/datasets/shard1/b.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"name": "b"
|
||||
}
|
3
test/tests/alias/datasets/shard1/d.json
Normal file
3
test/tests/alias/datasets/shard1/d.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"name": "d"
|
||||
}
|
3
test/tests/alias/mapping.json
Normal file
3
test/tests/alias/mapping.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"default_analyzer": "keyword"
|
||||
}
|
76
test/tests/alias/searches.json
Normal file
76
test/tests/alias/searches.json
Normal file
|
@ -0,0 +1,76 @@
|
|||
[
|
||||
{
|
||||
"comment": "match all across shards",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"match_all": {}
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 4,
|
||||
"hits": [
|
||||
{
|
||||
"id": "a"
|
||||
},
|
||||
{
|
||||
"id": "b"
|
||||
},
|
||||
{
|
||||
"id": "c"
|
||||
},
|
||||
{
|
||||
"id": "d"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "search after b (page 2 when size=2)",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 2,
|
||||
"sort": ["name"],
|
||||
"search_after": ["b"],
|
||||
"query": {
|
||||
"match_all": {}
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 4,
|
||||
"hits": [
|
||||
{
|
||||
"id": "c"
|
||||
},
|
||||
{
|
||||
"id": "d"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "search before c (page 1 when size=2)",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 2,
|
||||
"sort": ["name"],
|
||||
"search_before": ["c"],
|
||||
"query": {
|
||||
"match_all": {}
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 4,
|
||||
"hits": [
|
||||
{
|
||||
"id": "a"
|
||||
},
|
||||
{
|
||||
"id": "b"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
7
test/tests/basic/data/a.json
Normal file
7
test/tests/basic/data/a.json
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"id": "a",
|
||||
"name": "marty",
|
||||
"age": 19,
|
||||
"title": "mista",
|
||||
"tags": ["gopher", "belieber"]
|
||||
}
|
7
test/tests/basic/data/b.json
Normal file
7
test/tests/basic/data/b.json
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"id": "b",
|
||||
"name": "steve has <a> long & complicated name",
|
||||
"age": 27,
|
||||
"birthday": "2001-09-09T01:46:40Z",
|
||||
"title": "missess"
|
||||
}
|
7
test/tests/basic/data/c.json
Normal file
7
test/tests/basic/data/c.json
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"id": "c",
|
||||
"name": "bob walks home",
|
||||
"age": 64,
|
||||
"birthday": "2014-05-13T16:53:20Z",
|
||||
"title": "masta"
|
||||
}
|
7
test/tests/basic/data/d.json
Normal file
7
test/tests/basic/data/d.json
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"id": "d",
|
||||
"name": "bobbleheaded wings top the phone",
|
||||
"age": 72,
|
||||
"birthday": "2014-05-13T16:53:20Z",
|
||||
"title": "mizz"
|
||||
}
|
27
test/tests/basic/mapping.json
Normal file
27
test/tests/basic/mapping.json
Normal file
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"types": {
|
||||
"person": {
|
||||
"properties": {
|
||||
"name": {
|
||||
"fields": [
|
||||
{
|
||||
"include_term_vectors": true,
|
||||
"include_in_all": true,
|
||||
"index": true,
|
||||
"store": true,
|
||||
"analyzer": "en",
|
||||
"type": "text"
|
||||
}
|
||||
],
|
||||
"dynamic": true,
|
||||
"enabled": true
|
||||
},
|
||||
"id": {
|
||||
"dynamic": false,
|
||||
"enabled": false
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"default_type": "person"
|
||||
}
|
883
test/tests/basic/searches.json
Normal file
883
test/tests/basic/searches.json
Normal file
|
@ -0,0 +1,883 @@
|
|||
[
|
||||
{
|
||||
"comment": "test term search, exact match",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "name",
|
||||
"term": "marti"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "test term search, no match",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "name",
|
||||
"term": "noone"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 0,
|
||||
"hits": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "test match phrase search",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"match_phrase": "steve has"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "b"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "test term search, no match",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "name",
|
||||
"term": "walking"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 0,
|
||||
"hits": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "test match search, matching due to analysis",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"fuzziness": 0,
|
||||
"prefix_length": 0,
|
||||
"field": "name",
|
||||
"match": "walking"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "c"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "test term prefix search",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "name",
|
||||
"prefix": "bobble"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "d"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "test simple query string",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"query": "+name:phone"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "d"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "test numeric range, no lower bound",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "age",
|
||||
"max": 30
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 2,
|
||||
"hits": [
|
||||
{
|
||||
"id": "a"
|
||||
},
|
||||
{
|
||||
"id": "b"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "test numeric range, upper and lower bounds",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "age",
|
||||
"max": 30,
|
||||
"min": 20
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "b"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "test conjunction of numeric range, upper and lower bounds",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"conjuncts": [
|
||||
{
|
||||
"boost": 1,
|
||||
"field": "age",
|
||||
"min": 20
|
||||
},
|
||||
{
|
||||
"boost": 1,
|
||||
"field": "age",
|
||||
"max": 30
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "b"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "test date range, no upper bound",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "birthday",
|
||||
"start": "2010-01-01"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 2,
|
||||
"hits": [
|
||||
{
|
||||
"id": "c"
|
||||
},
|
||||
{
|
||||
"id": "d"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "test numeric range, no lower bound",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "birthday",
|
||||
"end": "2010-01-01"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "b"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "test term search, matching inside an array",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "tags",
|
||||
"term": "gopher"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "test term search, matching another element inside array",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "tags",
|
||||
"term": "belieber"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "test term search, not present in array",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "tags",
|
||||
"term": "notintagsarray"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 0,
|
||||
"hits": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "with size 0, total should be 1, but hits empty",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 0,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "name",
|
||||
"term": "marti"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "a search for doc a that includes tags field, verifies both values come back",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"fields": ["tags"],
|
||||
"query": {
|
||||
"field": "name",
|
||||
"term": "marti"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "a",
|
||||
"fields": {
|
||||
"tags": ["gopher", "belieber"]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "test fuzzy search, fuzziness 1 with match",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "name",
|
||||
"term": "msrti",
|
||||
"fuzziness": 1
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "highlight results",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "name",
|
||||
"match": "long"
|
||||
},
|
||||
"highlight": {
|
||||
"fields": ["name"]
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "b",
|
||||
"fragments": {
|
||||
"name": ["steve has <a> <mark>long</mark> & complicated name"]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "highlight results without specifying fields",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "name",
|
||||
"match": "long"
|
||||
},
|
||||
"highlight": {}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "b",
|
||||
"fragments": {
|
||||
"name": ["steve has <a> <mark>long</mark> & complicated name"]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "request fields",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"fields": ["age","birthday"],
|
||||
"query": {
|
||||
"field": "name",
|
||||
"match": "long"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "b",
|
||||
"fields": {
|
||||
"age": 27,
|
||||
"birthday": "2001-09-09T01:46:40Z"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "tests query string only containing MUST NOT clause, bug #193",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"query": "-title:mista"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 3,
|
||||
"hits": [
|
||||
{
|
||||
"id": "b"
|
||||
},
|
||||
{
|
||||
"id": "c"
|
||||
},
|
||||
{
|
||||
"id": "d"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "highlight results including non-matching field (which should be produced in its entirety, though unhighlighted)",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "name",
|
||||
"match": "long"
|
||||
},
|
||||
"highlight": {
|
||||
"fields": ["name", "title"]
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "b",
|
||||
"fragments": {
|
||||
"name": ["steve has <a> <mark>long</mark> & complicated name"],
|
||||
"title": ["missess"]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "search and highlight an array field",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "tags",
|
||||
"match": "gopher"
|
||||
},
|
||||
"highlight": {
|
||||
"fields": ["tags"]
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "a",
|
||||
"fragments": {
|
||||
"tags": ["<mark>gopher</mark>"]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "reproduce bug in prefix search",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "title",
|
||||
"prefix": "miss"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "b"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "test match none",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"match_none": {}
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 0,
|
||||
"hits": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "test match all",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"match_all": {}
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 4,
|
||||
"hits": [
|
||||
{
|
||||
"id": "a"
|
||||
},
|
||||
{
|
||||
"id": "b"
|
||||
},
|
||||
{
|
||||
"id": "c"
|
||||
},
|
||||
{
|
||||
"id": "d"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "test doc id query",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"ids": ["b", "c"]
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 2,
|
||||
"hits": [
|
||||
{
|
||||
"id": "b"
|
||||
},
|
||||
{
|
||||
"id": "c"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "test query string MUST and SHOULD",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"query": "+age:>20 missess"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 3,
|
||||
"hits": [
|
||||
{
|
||||
"id": "b"
|
||||
},
|
||||
{
|
||||
"id": "c"
|
||||
},
|
||||
{
|
||||
"id": "d"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "test regexp matching term",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "name",
|
||||
"regexp": "mar.*"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "test regexp that should not match when properly anchored",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "name",
|
||||
"regexp": "mar."
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 0,
|
||||
"hits": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "test wildcard matching term",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "name",
|
||||
"wildcard": "mar*"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "test boost - term query",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"disjuncts": [
|
||||
{
|
||||
"field": "name",
|
||||
"term": "marti",
|
||||
"boost": 1.0
|
||||
},
|
||||
{
|
||||
"field": "name",
|
||||
"term": "steve",
|
||||
"boost": 5.0
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 2,
|
||||
"hits": [
|
||||
{
|
||||
"id": "b"
|
||||
},
|
||||
{
|
||||
"id": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "test boost - term query",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"disjuncts": [
|
||||
{
|
||||
"field": "name",
|
||||
"term": "marti",
|
||||
"boost": 1.0
|
||||
},
|
||||
{
|
||||
"fuzziness": 1,
|
||||
"field": "name",
|
||||
"term": "steve",
|
||||
"boost": 5.0
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 2,
|
||||
"hits": [
|
||||
{
|
||||
"id": "b"
|
||||
},
|
||||
{
|
||||
"id": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "test boost - numeric range query",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"disjuncts": [
|
||||
{
|
||||
"field": "name",
|
||||
"term": "marti",
|
||||
"boost": 1.0
|
||||
},
|
||||
{
|
||||
"field": "age",
|
||||
"min": 25,
|
||||
"max": 29,
|
||||
"boost": 50.0
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 2,
|
||||
"hits": [
|
||||
{
|
||||
"id": "b"
|
||||
},
|
||||
{
|
||||
"id": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "test boost - regexp query",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"disjuncts": [
|
||||
{
|
||||
"field": "name",
|
||||
"term": "marti",
|
||||
"boost": 1.0
|
||||
},
|
||||
{
|
||||
"field": "name",
|
||||
"regexp": "stev.*",
|
||||
"boost": 5.0
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 2,
|
||||
"hits": [
|
||||
{
|
||||
"id": "b"
|
||||
},
|
||||
{
|
||||
"id": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "test wildcard inside query string",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"query": "name:mar*"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "test regexp inside query string",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"query": "name:/mar.*/"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "test term range",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "title",
|
||||
"max": "miz",
|
||||
"min": "mis"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 2,
|
||||
"hits": [
|
||||
{
|
||||
"id": "a"
|
||||
},
|
||||
{
|
||||
"id": "b"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
44
test/tests/employee/data/emp10508560.json
Normal file
44
test/tests/employee/data/emp10508560.json
Normal file
|
@ -0,0 +1,44 @@
|
|||
{
|
||||
"salary": 104561.8,
|
||||
"_type": "emp",
|
||||
"name": "Deirdre Reed",
|
||||
"mutated": 0,
|
||||
"is_manager": true,
|
||||
"dept": "Accounts",
|
||||
"join_date": "2003-05-28T21:29:00",
|
||||
"manages": {
|
||||
"team_size": 9,
|
||||
"reports": [
|
||||
"Gallia Julián",
|
||||
"Duvessa Nicolás",
|
||||
"Beryl Thomas",
|
||||
"Deirdre Julián",
|
||||
"Antonia Gerónimo",
|
||||
"Ciara Young",
|
||||
"Riona Richardson IX",
|
||||
"Severin Jr.",
|
||||
"Perdita Morgan"
|
||||
]
|
||||
},
|
||||
"languages_known": [
|
||||
"English",
|
||||
"Spanish",
|
||||
"German",
|
||||
"Italian",
|
||||
"French",
|
||||
"Arabic",
|
||||
"Africans",
|
||||
"Hindi",
|
||||
"Vietnamese",
|
||||
"Urdu",
|
||||
"Dutch",
|
||||
"Quechua",
|
||||
"Japanese",
|
||||
"Chinese",
|
||||
"Nepalese",
|
||||
"Thai",
|
||||
"Malay"
|
||||
],
|
||||
"emp_id": "10508560",
|
||||
"email": "deirdre@mcdiabetes.com"
|
||||
}
|
1
test/tests/employee/mapping.json
Normal file
1
test/tests/employee/mapping.json
Normal file
|
@ -0,0 +1 @@
|
|||
{}
|
41
test/tests/employee/searches.json
Normal file
41
test/tests/employee/searches.json
Normal file
|
@ -0,0 +1,41 @@
|
|||
[
|
||||
{
|
||||
"comment": "test array position output",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "manages.reports",
|
||||
"term": "julián"
|
||||
},
|
||||
"includeLocations": true
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "emp10508560",
|
||||
"locations": {
|
||||
"manages.reports": {
|
||||
"julián": [
|
||||
{
|
||||
"pos": 2,
|
||||
"start": 7,
|
||||
"end": 14,
|
||||
"array_positions":[0]
|
||||
},
|
||||
{
|
||||
"pos": 2,
|
||||
"start": 8,
|
||||
"end": 15,
|
||||
"array_positions":[3]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
6
test/tests/facet/data/a.json
Normal file
6
test/tests/facet/data/a.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"category": "inventory",
|
||||
"type": "book",
|
||||
"rating": 2,
|
||||
"updated": "2014-11-25"
|
||||
}
|
6
test/tests/facet/data/b.json
Normal file
6
test/tests/facet/data/b.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"category": "inventory",
|
||||
"type": "book",
|
||||
"rating": 7,
|
||||
"updated": "2013-07-25"
|
||||
}
|
6
test/tests/facet/data/c.json
Normal file
6
test/tests/facet/data/c.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"category": "inventory",
|
||||
"type": "book",
|
||||
"rating": 1,
|
||||
"updated": "2014-03-03"
|
||||
}
|
6
test/tests/facet/data/d.json
Normal file
6
test/tests/facet/data/d.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"category": "inventory",
|
||||
"type": "book",
|
||||
"rating": 9,
|
||||
"updated": "2014-09-16"
|
||||
}
|
6
test/tests/facet/data/e.json
Normal file
6
test/tests/facet/data/e.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"category": "inventory",
|
||||
"type": "book",
|
||||
"rating": 5,
|
||||
"updated": "2014-11-15"
|
||||
}
|
6
test/tests/facet/data/f.json
Normal file
6
test/tests/facet/data/f.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"category": "inventory",
|
||||
"type": "movie",
|
||||
"rating": 3,
|
||||
"updated": "2017-06-05"
|
||||
}
|
6
test/tests/facet/data/g.json
Normal file
6
test/tests/facet/data/g.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"category": "inventory",
|
||||
"type": "movie",
|
||||
"rating": 9,
|
||||
"updated": "2011-10-03"
|
||||
}
|
6
test/tests/facet/data/h.json
Normal file
6
test/tests/facet/data/h.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"category": "inventory",
|
||||
"type": "movie",
|
||||
"rating": 9,
|
||||
"updated": "2019-08-26"
|
||||
}
|
6
test/tests/facet/data/i.json
Normal file
6
test/tests/facet/data/i.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"category": "inventory",
|
||||
"type": "movie",
|
||||
"rating": 1,
|
||||
"updated": "2014-12-14"
|
||||
}
|
6
test/tests/facet/data/j.json
Normal file
6
test/tests/facet/data/j.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"category": "inventory",
|
||||
"type": "game",
|
||||
"rating": 9,
|
||||
"updated": "2013-10-20"
|
||||
}
|
1
test/tests/facet/mapping.json
Normal file
1
test/tests/facet/mapping.json
Normal file
|
@ -0,0 +1 @@
|
|||
{}
|
144
test/tests/facet/searches.json
Normal file
144
test/tests/facet/searches.json
Normal file
|
@ -0,0 +1,144 @@
|
|||
[
|
||||
{
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 0,
|
||||
"query": {
|
||||
"field": "category",
|
||||
"term": "inventory"
|
||||
},
|
||||
"facets": {
|
||||
"types": {
|
||||
"size": 3,
|
||||
"field": "type"
|
||||
}
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 10,
|
||||
"hits": [],
|
||||
"facets": {
|
||||
"types": {
|
||||
"field": "type",
|
||||
"total": 10,
|
||||
"missing": 0,
|
||||
"other": 0,
|
||||
"terms": [
|
||||
{
|
||||
"term": "book",
|
||||
"count": 5
|
||||
},
|
||||
{
|
||||
"term": "movie",
|
||||
"count": 4
|
||||
},
|
||||
{
|
||||
"term": "game",
|
||||
"count": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 0,
|
||||
"query": {
|
||||
"field": "category",
|
||||
"term": "inventory"
|
||||
},
|
||||
"facets": {
|
||||
"types": {
|
||||
"size": 3,
|
||||
"field": "rating",
|
||||
"numeric_ranges": [
|
||||
{
|
||||
"name": "low",
|
||||
"max": 5
|
||||
},
|
||||
{
|
||||
"name": "high",
|
||||
"min": 5
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 10,
|
||||
"hits": [],
|
||||
"facets": {
|
||||
"types": {
|
||||
"field": "rating",
|
||||
"total": 10,
|
||||
"missing": 0,
|
||||
"other": 0,
|
||||
"numeric_ranges": [
|
||||
{
|
||||
"name": "high",
|
||||
"count": 6,
|
||||
"min": 5
|
||||
},
|
||||
{
|
||||
"name": "low",
|
||||
"count": 4,
|
||||
"max": 5
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 0,
|
||||
"query": {
|
||||
"field": "category",
|
||||
"term": "inventory"
|
||||
},
|
||||
"facets": {
|
||||
"types": {
|
||||
"size": 3,
|
||||
"field": "updated",
|
||||
"date_ranges": [
|
||||
{
|
||||
"name": "old",
|
||||
"end": "2012-01-01"
|
||||
},
|
||||
{
|
||||
"name": "new",
|
||||
"start": "2012-01-01"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 10,
|
||||
"hits": [],
|
||||
"facets": {
|
||||
"types": {
|
||||
"field": "updated",
|
||||
"total": 10,
|
||||
"missing": 0,
|
||||
"other": 0,
|
||||
"date_ranges": [
|
||||
{
|
||||
"name": "new",
|
||||
"count": 9,
|
||||
"start": "2012-01-01T00:00:00Z"
|
||||
},
|
||||
{
|
||||
"name": "old",
|
||||
"count": 1,
|
||||
"end": "2012-01-01T00:00:00Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
4
test/tests/fosdem/data/3311@FOSDEM15@fosdem.org.json
Normal file
4
test/tests/fosdem/data/3311@FOSDEM15@fosdem.org.json
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"description": "From Prolog to Erlang to Haskell to Lisp to TLC and then back to Prolog I have journeyed, and I'd like to share some of the beautiful",
|
||||
"category": "Word"
|
||||
}
|
4
test/tests/fosdem/data/3492@FOSDEM15@fosdem.org.json
Normal file
4
test/tests/fosdem/data/3492@FOSDEM15@fosdem.org.json
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"description": "different cats",
|
||||
"category": "Perl"
|
||||
}
|
4
test/tests/fosdem/data/3496@FOSDEM15@fosdem.org.json
Normal file
4
test/tests/fosdem/data/3496@FOSDEM15@fosdem.org.json
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"description": "many cats",
|
||||
"category": "Perl"
|
||||
}
|
4
test/tests/fosdem/data/3505@FOSDEM15@fosdem.org.json
Normal file
4
test/tests/fosdem/data/3505@FOSDEM15@fosdem.org.json
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"description": "From Prolog to Erlang to Haskell to Lisp to TLC and then back to Prolog I have journeyed, and I'd like to share some of the beautiful",
|
||||
"category": "Perl"
|
||||
}
|
4
test/tests/fosdem/data/3507@FOSDEM15@fosdem.org.json
Normal file
4
test/tests/fosdem/data/3507@FOSDEM15@fosdem.org.json
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"description": "From Prolog to Erlang to Haskell to Gel to TLC and then back to Prolog I have journeyed, and I'd like to share some of the beautiful",
|
||||
"category": "Perl"
|
||||
}
|
76
test/tests/fosdem/mapping.json
Normal file
76
test/tests/fosdem/mapping.json
Normal file
|
@ -0,0 +1,76 @@
|
|||
{
|
||||
"default_mapping": {
|
||||
"enabled": true,
|
||||
"dynamic": true,
|
||||
"properties": {
|
||||
"category": {
|
||||
"enabled": true,
|
||||
"dynamic": true,
|
||||
"fields": [
|
||||
{
|
||||
"type": "text",
|
||||
"analyzer": "keyword",
|
||||
"store": true,
|
||||
"index": true,
|
||||
"include_term_vectors": true,
|
||||
"include_in_all": true
|
||||
}
|
||||
],
|
||||
"default_analyzer": ""
|
||||
},
|
||||
"description": {
|
||||
"enabled": true,
|
||||
"dynamic": true,
|
||||
"fields": [
|
||||
{
|
||||
"type": "text",
|
||||
"analyzer": "en",
|
||||
"store": true,
|
||||
"index": true,
|
||||
"include_term_vectors": true,
|
||||
"include_in_all": true
|
||||
}
|
||||
],
|
||||
"default_analyzer": ""
|
||||
},
|
||||
"summary": {
|
||||
"enabled": true,
|
||||
"dynamic": true,
|
||||
"fields": [
|
||||
{
|
||||
"type": "text",
|
||||
"analyzer": "en",
|
||||
"store": true,
|
||||
"index": true,
|
||||
"include_term_vectors": true,
|
||||
"include_in_all": true
|
||||
}
|
||||
],
|
||||
"default_analyzer": ""
|
||||
},
|
||||
"url": {
|
||||
"enabled": true,
|
||||
"dynamic": true,
|
||||
"fields": [
|
||||
{
|
||||
"type": "text",
|
||||
"analyzer": "keyword",
|
||||
"store": true,
|
||||
"index": true,
|
||||
"include_term_vectors": true,
|
||||
"include_in_all": true
|
||||
}
|
||||
],
|
||||
"default_analyzer": ""
|
||||
}
|
||||
},
|
||||
"default_analyzer": ""
|
||||
},
|
||||
"type_field": "_type",
|
||||
"default_type": "_default",
|
||||
"default_analyzer": "en",
|
||||
"default_datetime_parser": "dateTimeOptional",
|
||||
"default_field": "_all",
|
||||
"byte_array_converter": "json",
|
||||
"analysis": {}
|
||||
}
|
109
test/tests/fosdem/searches.json
Normal file
109
test/tests/fosdem/searches.json
Normal file
|
@ -0,0 +1,109 @@
|
|||
[
|
||||
{
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "category",
|
||||
"match_phrase": "Perl"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 4,
|
||||
"hits": [
|
||||
{
|
||||
"id": "3492@FOSDEM15@fosdem.org"
|
||||
},
|
||||
{
|
||||
"id": "3496@FOSDEM15@fosdem.org"
|
||||
},
|
||||
{
|
||||
"id": "3505@FOSDEM15@fosdem.org"
|
||||
},
|
||||
{
|
||||
"id": "3507@FOSDEM15@fosdem.org"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"match": "lisp"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 2,
|
||||
"hits": [
|
||||
{
|
||||
"id": "3311@FOSDEM15@fosdem.org"
|
||||
},
|
||||
{
|
||||
"id": "3505@FOSDEM15@fosdem.org"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {"boost":1,"query":"+lisp +category:Perl"}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "3505@FOSDEM15@fosdem.org"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {"boost":1,"query":"+lisp +category:\"Perl\""}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "3505@FOSDEM15@fosdem.org"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"must": {
|
||||
"conjuncts":[
|
||||
{"boost":1,"query":"+cats"},
|
||||
{"field":"category","match_phrase":"Perl"}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 2,
|
||||
"hits": [
|
||||
{
|
||||
"id": "3492@FOSDEM15@fosdem.org"
|
||||
},
|
||||
{
|
||||
"id": "3496@FOSDEM15@fosdem.org"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
1
test/tests/geo/data/amoeba_brewery.json
Normal file
1
test/tests/geo/data/amoeba_brewery.json
Normal file
|
@ -0,0 +1 @@
|
|||
{"name":"amoeba brewery","city":"bangalore","state":"KAR","code":"","country":"India","phone":"","website":"","type":"brewery","updated":"2019-09-17 20:00:20","description":"brewery near cb office","address":[],"geo":{"accuracy":"APPROXIMATE","lat":12.97467,"lon":77.60490}}
|
1
test/tests/geo/data/brewpub_on_the_green.json
Normal file
1
test/tests/geo/data/brewpub_on_the_green.json
Normal file
|
@ -0,0 +1 @@
|
|||
{"name":"Brewpub-on-the-Green","city":"Fremont","state":"California","code":"","country":"United States","phone":"","website":"","type":"brewery","updated":"2010-07-22 20:00:20","description":"","address":[],"geo":{"accuracy":"APPROXIMATE","lat":37.5483,"lon":-121.989}}
|
1
test/tests/geo/data/capital_city_brewing_company.json
Normal file
1
test/tests/geo/data/capital_city_brewing_company.json
Normal file
|
@ -0,0 +1 @@
|
|||
{"name":"Capital City Brewing Company","city":"Washington","state":"District of Columbia","code":"20005","country":"United States","phone":"202.628.2222","website":"http://www.capcitybrew.com","type":"brewery","updated":"2010-07-22 20:00:20","description":"Washington DC's first brewpub since prohibition, Capitol City Brewing Co. opened its doors in 1992. Our first location still stands in Downtown DC, at 11th and H St., NW. Our company policy is to bring the fine craft of brewing to every person who lives and visits our region, as well as treating them to a wonderful meal and a great experience.","address":["1100 New York Ave, NW"],"geo":{"accuracy":"ROOFTOP","lat":38.8999,"lon":-77.0272}}
|
1
test/tests/geo/data/communiti_brewery.json
Normal file
1
test/tests/geo/data/communiti_brewery.json
Normal file
|
@ -0,0 +1 @@
|
|||
{"name":"communiti brewery","city":"bangalore","state":"KAR","code":"","country":"India","phone":"","website":"","type":"brewery","updated":"2019-09-17 20:00:20","description":"brewery near cb office","address":[],"geo":{"accuracy":"APPROXIMATE","lat":12.97237,"lon":77.608237}}
|
1
test/tests/geo/data/firehouse_grill_brewery.json
Normal file
1
test/tests/geo/data/firehouse_grill_brewery.json
Normal file
|
@ -0,0 +1 @@
|
|||
{"name":"Firehouse Grill & Brewery","city":"Sunnyvale","state":"California","code":"94086","country":"United States","phone":"1-408-773-9500","website":"","type":"brewery","updated":"2010-07-22 20:00:20","description":"","address":["111 South Murphy Avenue"],"geo":{"accuracy":"RANGE_INTERPOLATED","lat":37.3775,"lon":-122.03}}
|
1
test/tests/geo/data/hook_ladder_brewing_company.json
Normal file
1
test/tests/geo/data/hook_ladder_brewing_company.json
Normal file
|
@ -0,0 +1 @@
|
|||
{"name":"Hook & Ladder Brewing Company","city":"Silver Spring","state":"Maryland","code":"20910","country":"United States","phone":"301.565.4522","website":"http://www.hookandladderbeer.com","type":"brewery","updated":"2010-07-22 20:00:20","description":"At Hook & Ladder Brewing we believe in great beer in the company of good friends, so we bring you three great beers for your drinking pleasure (please drink responsibly). Each of our beers is carefully crafted with the finest quality ingredients for a distinctive taste we know you will enjoy. Try one tonight, you just might get hooked. Through our own experiences in the fire and rescue service we have chosen the Hook & Ladder as a symbol of pride and honor to pay tribute to the brave men and women who serve and protect our communities.","address":["8113 Fenton St."],"geo":{"accuracy":"ROOFTOP","lat":38.9911,"lon":-77.0237}}
|
1
test/tests/geo/data/jack_s_brewing.json
Normal file
1
test/tests/geo/data/jack_s_brewing.json
Normal file
|
@ -0,0 +1 @@
|
|||
{"name":"Jack's Brewing","city":"Fremont","state":"California","code":"94538","country":"United States","phone":"1-510-796-2036","website":"","type":"brewery","updated":"2010-07-22 20:00:20","description":"","address":["39176 Argonaut Way"],"geo":{"accuracy":"ROOFTOP","lat":37.5441,"lon":-121.988}}
|
1
test/tests/geo/data/social_brewery.json
Normal file
1
test/tests/geo/data/social_brewery.json
Normal file
|
@ -0,0 +1 @@
|
|||
{"name":"social brewery","city":"bangalore","state":"KAR","code":"","country":"India","phone":"","website":"","type":"brewery","updated":"2019-09-17 20:00:20","description":"brewery near cb office, but outside the polygon","address":[],"geo":{"accuracy":"APPROXIMATE","lat":12.9736946,"lon":77.6042133}}
|
1
test/tests/geo/data/sweet_water_tavern_and_brewery.json
Normal file
1
test/tests/geo/data/sweet_water_tavern_and_brewery.json
Normal file
|
@ -0,0 +1 @@
|
|||
{"name":"Sweet Water Tavern and Brewery","city":"Sterling","state":"Virginia","code":"20121","country":"United States","phone":"(703) 449-1108","website":"http://www.greatamericanrestaurants.com/sweetMainSter/index.htm","type":"brewery","updated":"2010-07-22 20:00:20","description":"","address":["45980 Waterview Plaza"],"geo":{"accuracy":"RANGE_INTERPOLATED","lat":39.0324,"lon":-77.4097}}
|
36
test/tests/geo/mapping.json
Normal file
36
test/tests/geo/mapping.json
Normal file
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
"types": {
|
||||
"brewery": {
|
||||
"properties": {
|
||||
"name": {
|
||||
"fields": [
|
||||
{
|
||||
"include_term_vectors": true,
|
||||
"include_in_all": true,
|
||||
"index": true,
|
||||
"store": true,
|
||||
"analyzer": "keyword",
|
||||
"type": "text"
|
||||
}
|
||||
],
|
||||
"dynamic": true,
|
||||
"enabled": true
|
||||
},
|
||||
"geo": {
|
||||
"fields": [
|
||||
{
|
||||
"include_term_vectors": true,
|
||||
"include_in_all": true,
|
||||
"index": true,
|
||||
"store": true,
|
||||
"type": "geopoint"
|
||||
}
|
||||
],
|
||||
"dynamic": true,
|
||||
"enabled": true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"default_type": "brewery"
|
||||
}
|
326
test/tests/geo/searches.json
Normal file
326
test/tests/geo/searches.json
Normal file
|
@ -0,0 +1,326 @@
|
|||
[
|
||||
{
|
||||
"comment": "breweries near the couchbase office",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"query": {
|
||||
"location": {
|
||||
"lon": -122.107799,
|
||||
"lat": 37.399285
|
||||
},
|
||||
"distance": "100mi",
|
||||
"field": "geo"
|
||||
},
|
||||
"sort": [
|
||||
{
|
||||
"by": "geo_distance",
|
||||
"field": "geo",
|
||||
"unit": "mi",
|
||||
"location": {
|
||||
"lon": -122.107799,
|
||||
"lat": 37.399285
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 3,
|
||||
"hits": [
|
||||
{
|
||||
"id": "firehouse_grill_brewery"
|
||||
},
|
||||
{
|
||||
"id": "jack_s_brewing"
|
||||
},
|
||||
{
|
||||
"id": "brewpub_on_the_green"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "breweries near the whitehouse",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"query": {
|
||||
"location": {
|
||||
"lon": -77.0365,
|
||||
"lat": 38.8977
|
||||
},
|
||||
"distance": "100mi",
|
||||
"field": "geo"
|
||||
},
|
||||
"sort": [
|
||||
{
|
||||
"by": "geo_distance",
|
||||
"field": "geo",
|
||||
"unit": "mi",
|
||||
"location": {
|
||||
"lon": -77.0365,
|
||||
"lat": 38.8977
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 3,
|
||||
"hits": [
|
||||
{
|
||||
"id": "capital_city_brewing_company"
|
||||
},
|
||||
{
|
||||
"id": "hook_ladder_brewing_company"
|
||||
},
|
||||
{
|
||||
"id": "sweet_water_tavern_and_brewery"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "bounding box of USA",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"query": {
|
||||
"top_left": {
|
||||
"lon": -125.0011,
|
||||
"lat": 49.5904
|
||||
},
|
||||
"bottom_right": {
|
||||
"lon": -66.9326,
|
||||
"lat": 24.9493
|
||||
},
|
||||
"field": "geo"
|
||||
},
|
||||
"sort": [
|
||||
"name"
|
||||
]
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 6,
|
||||
"hits": [
|
||||
{
|
||||
"id": "brewpub_on_the_green"
|
||||
},
|
||||
{
|
||||
"id": "capital_city_brewing_company"
|
||||
},
|
||||
{
|
||||
"id": "firehouse_grill_brewery"
|
||||
},
|
||||
{
|
||||
"id": "hook_ladder_brewing_company"
|
||||
},
|
||||
{
|
||||
"id": "jack_s_brewing"
|
||||
},
|
||||
{
|
||||
"id": "sweet_water_tavern_and_brewery"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "bounding box around DC area",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"query": {
|
||||
"top_left": {
|
||||
"lon": -78,
|
||||
"lat": 39.5
|
||||
},
|
||||
"bottom_right": {
|
||||
"lon": -76,
|
||||
"lat": 38.5
|
||||
},
|
||||
"field": "geo"
|
||||
},
|
||||
"sort": [
|
||||
"name"
|
||||
]
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 3,
|
||||
"hits": [
|
||||
{
|
||||
"id": "capital_city_brewing_company"
|
||||
},
|
||||
{
|
||||
"id": "hook_ladder_brewing_company"
|
||||
},
|
||||
{
|
||||
"id": "sweet_water_tavern_and_brewery"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "breweries near the couchbase office, using GeoJSON style points",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"query": {
|
||||
"location": [-122.107799,37.399285],
|
||||
"distance": "100mi",
|
||||
"field": "geo"
|
||||
},
|
||||
"sort": [
|
||||
{
|
||||
"by": "geo_distance",
|
||||
"field": "geo",
|
||||
"unit": "mi",
|
||||
"location": [-122.107799,37.399285]
|
||||
}
|
||||
]
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 3,
|
||||
"hits": [
|
||||
{
|
||||
"id": "firehouse_grill_brewery"
|
||||
},
|
||||
{
|
||||
"id": "jack_s_brewing"
|
||||
},
|
||||
{
|
||||
"id": "brewpub_on_the_green"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "bounding box around DC area, using GeoJSON style",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"query": {
|
||||
"top_left": [-78,39.5],
|
||||
"bottom_right": [-76,38.5],
|
||||
"field": "geo"
|
||||
},
|
||||
"sort": [
|
||||
"name"
|
||||
]
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 3,
|
||||
"hits": [
|
||||
{
|
||||
"id": "capital_city_brewing_company"
|
||||
},
|
||||
{
|
||||
"id": "hook_ladder_brewing_company"
|
||||
},
|
||||
{
|
||||
"id": "sweet_water_tavern_and_brewery"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "polygon around cb office area, using GeoJSON lat/lon as array",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"query": {
|
||||
"polygon_points": [[77.607749,12.974872],[77.6101101,12.971725],[77.606912,12.972530],[77.603780,12.975112]],
|
||||
"field": "geo"
|
||||
},
|
||||
"sort": [
|
||||
"name"
|
||||
]
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 2,
|
||||
"hits": [
|
||||
{
|
||||
"id": "amoeba_brewery"
|
||||
},
|
||||
{
|
||||
"id": "communiti_brewery"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "polygon around cb office area, using GeoJSON lat/lon as string",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"query": {
|
||||
"polygon_points": ["12.974872, 77.607749","12.971725, 77.6101101","12.972530, 77.606912","12.975112, 77.603780"],
|
||||
"field": "geo"
|
||||
},
|
||||
"sort": [
|
||||
"name"
|
||||
]
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 2,
|
||||
"hits": [
|
||||
{
|
||||
"id": "amoeba_brewery"
|
||||
},
|
||||
{
|
||||
"id": "communiti_brewery"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "polygon around cb office area",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"query": {
|
||||
"polygon_points": [{"lat":12.974872, "lon":77.607749}, {"lat":12.971725, "lon":77.6101101},
|
||||
{"lat":12.972530, "lon":77.606912}, {"lat":12.975112, "lon":77.603780}],
|
||||
"field": "geo"
|
||||
},
|
||||
"sort": [
|
||||
"name"
|
||||
]
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 2,
|
||||
"hits": [
|
||||
{
|
||||
"id": "amoeba_brewery"
|
||||
},
|
||||
{
|
||||
"id": "communiti_brewery"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "polygon around cb office area as geohash",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"query": {
|
||||
"polygon_points": ["tdr1y40", "tdr1y13", "tdr1vcx", "tdr1vfj"],
|
||||
"field": "geo"
|
||||
},
|
||||
"sort": [
|
||||
"name"
|
||||
]
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 2,
|
||||
"hits": [
|
||||
{
|
||||
"id": "amoeba_brewery"
|
||||
},
|
||||
{
|
||||
"id": "communiti_brewery"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
|
14
test/tests/geoshapes/data/circle_halairport.json
Normal file
14
test/tests/geoshapes/data/circle_halairport.json
Normal file
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"name": "hal airpork circular region",
|
||||
"city": "bangalore",
|
||||
"type": "geoshapes",
|
||||
"description": "circle covering the hal airport",
|
||||
"region": {
|
||||
"type": "Circle",
|
||||
"coordinates": [
|
||||
77.6698637008667,
|
||||
12.951865687866821
|
||||
],
|
||||
"radius": "2.4km"
|
||||
}
|
||||
}
|
19
test/tests/geoshapes/data/envelope_brockwell_park.json
Normal file
19
test/tests/geoshapes/data/envelope_brockwell_park.json
Normal file
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"name": "brockwell park envelope",
|
||||
"city": "london",
|
||||
"type": "geoshapes",
|
||||
"description": "brockwell park envelope",
|
||||
"region": {
|
||||
"type": "envelope",
|
||||
"coordinates": [
|
||||
[
|
||||
-0.11278152465820314,
|
||||
51.44579626059569
|
||||
],
|
||||
[
|
||||
-0.10037899017333984,
|
||||
51.45566490761856
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
165
test/tests/geoshapes/data/geometrycollection_tvm.json
Normal file
165
test/tests/geoshapes/data/geometrycollection_tvm.json
Normal file
|
@ -0,0 +1,165 @@
|
|||
{
|
||||
"name": "geometrycollection comprised of various shapes",
|
||||
"city": "bangalore",
|
||||
"type": "geoshapes",
|
||||
"description": "geometrycollection comprised of various shapes",
|
||||
"region": {
|
||||
"type": "geometrycollection",
|
||||
"geometries": [
|
||||
{
|
||||
"type": "point",
|
||||
"coordinates": [
|
||||
76.92815780639648,
|
||||
8.525851789596233
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "LineString",
|
||||
"coordinates": [
|
||||
[
|
||||
76.92867279052734,
|
||||
8.490369393806219
|
||||
],
|
||||
[
|
||||
76.94377899169922,
|
||||
8.494104537551882
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "polygon",
|
||||
"coordinates": [
|
||||
[
|
||||
[
|
||||
76.92815780639648,
|
||||
8.525851789596233
|
||||
],
|
||||
[
|
||||
76.92060470581055,
|
||||
8.520504174874656
|
||||
],
|
||||
[
|
||||
76.92206382751465,
|
||||
8.519061154914393
|
||||
],
|
||||
[
|
||||
76.92824363708496,
|
||||
8.519061154914393
|
||||
],
|
||||
[
|
||||
76.92970275878906,
|
||||
8.523475081176768
|
||||
],
|
||||
[
|
||||
76.92815780639648,
|
||||
8.525851789596233
|
||||
]
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "multipoint",
|
||||
"coordinates": [
|
||||
[
|
||||
76.90670013427733,
|
||||
8.497839644932787
|
||||
],
|
||||
[
|
||||
76.94137573242188,
|
||||
8.485275957394883
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "multiLineString",
|
||||
"coordinates": [
|
||||
[
|
||||
[
|
||||
76.89322471618651,
|
||||
8.521522773921424
|
||||
],
|
||||
[
|
||||
76.89648628234863,
|
||||
8.518042549311815
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
76.9068717956543,
|
||||
8.494783650690053
|
||||
],
|
||||
[
|
||||
76.93296432495117,
|
||||
8.468552033040881
|
||||
]
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "multipolygon",
|
||||
"coordinates": [
|
||||
[
|
||||
[
|
||||
[
|
||||
76.90249443054199,
|
||||
8.546138091708775
|
||||
],
|
||||
[
|
||||
76.89983367919922,
|
||||
8.541300033890494
|
||||
],
|
||||
[
|
||||
76.90498352050781,
|
||||
8.53985709248573
|
||||
],
|
||||
[
|
||||
76.90858840942383,
|
||||
8.54520443620746
|
||||
],
|
||||
[
|
||||
76.90712928771973,
|
||||
8.548090273095957
|
||||
],
|
||||
[
|
||||
76.90249443054199,
|
||||
8.546138091708775
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
[
|
||||
76.88326835632324,
|
||||
8.564131732621458
|
||||
],
|
||||
[
|
||||
76.88429832458496,
|
||||
8.555729147617923
|
||||
],
|
||||
[
|
||||
76.88893318176268,
|
||||
8.552079482230221
|
||||
],
|
||||
[
|
||||
76.89339637756348,
|
||||
8.55369212938781
|
||||
],
|
||||
[
|
||||
76.89494132995605,
|
||||
8.56133089156368
|
||||
],
|
||||
[
|
||||
76.89116477966309,
|
||||
8.566423314514562
|
||||
],
|
||||
[
|
||||
76.88326835632324,
|
||||
8.564131732621458
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
19
test/tests/geoshapes/data/linestring_putney_bridge.json
Normal file
19
test/tests/geoshapes/data/linestring_putney_bridge.json
Normal file
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"name": "linestring for putney bridge",
|
||||
"city": "london",
|
||||
"type": "geoshapes",
|
||||
"description": "linestring for putney bridge",
|
||||
"region": {
|
||||
"type": "linestring",
|
||||
"coordinates": [
|
||||
[
|
||||
-0.21183013916015625,
|
||||
51.46791083061189
|
||||
],
|
||||
[
|
||||
-0.21431922912597656,
|
||||
51.465504685939706
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
"name": "road routes",
|
||||
"city": "bangalore",
|
||||
"type": "geoshapes",
|
||||
"description": "multilinestrings approximating the roads indiranagar 100ft and old airport port road",
|
||||
"region": {
|
||||
"type": "multilinestring",
|
||||
"coordinates": [
|
||||
[
|
||||
[
|
||||
77.64081001281738,
|
||||
12.983398626256326
|
||||
],
|
||||
[
|
||||
77.64166831970213,
|
||||
12.960648472679763
|
||||
]
|
||||
],
|
||||
[ [
|
||||
77.64192581176758,
|
||||
12.960564828571133
|
||||
],
|
||||
[
|
||||
77.66990661621094,
|
||||
12.958390071883693
|
||||
]
|
||||
],
|
||||
[ [
|
||||
77.67016410827637,
|
||||
12.958055492245812
|
||||
],
|
||||
[
|
||||
77.68106460571289,
|
||||
12.954626025039444
|
||||
]
|
||||
],
|
||||
[ [
|
||||
77.68149375915527,
|
||||
12.954542378907867
|
||||
],
|
||||
[
|
||||
77.7011489868164,
|
||||
12.957219041184294
|
||||
]
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
23
test/tests/geoshapes/data/multipoint_blr_stadiums.json
Normal file
23
test/tests/geoshapes/data/multipoint_blr_stadiums.json
Normal file
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"name": "multipoints for stadiums",
|
||||
"city": "bangalore",
|
||||
"type": "geoshapes",
|
||||
"description": "contains 3 points",
|
||||
"region": {
|
||||
"type": "multipoint",
|
||||
"coordinates": [
|
||||
[
|
||||
77.5929594039917,
|
||||
12.969347306502671
|
||||
],
|
||||
[
|
||||
77.6004695892334,
|
||||
12.979007674139009
|
||||
],
|
||||
[
|
||||
77.60068416595459,
|
||||
12.961735843534306
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
87
test/tests/geoshapes/data/multipolygon_london_parks.json
Normal file
87
test/tests/geoshapes/data/multipolygon_london_parks.json
Normal file
|
@ -0,0 +1,87 @@
|
|||
{
|
||||
"name": "london parks as multipolygon",
|
||||
"city": "london",
|
||||
"type": "geoshapes",
|
||||
"description": "multipolygon with london",
|
||||
"region": {
|
||||
"type": "MultiPolygon",
|
||||
"coordinates": [
|
||||
[
|
||||
[
|
||||
[
|
||||
-0.163421630859375,
|
||||
51.531600743186644
|
||||
],
|
||||
[
|
||||
-0.15277862548828125,
|
||||
51.52455221546295
|
||||
],
|
||||
[
|
||||
-0.14556884765625,
|
||||
51.524979430024345
|
||||
],
|
||||
[
|
||||
-0.14591217041015625,
|
||||
51.536085601784755
|
||||
],
|
||||
[
|
||||
-0.15895843505859375,
|
||||
51.53693981046689
|
||||
],
|
||||
[
|
||||
-0.163421630859375,
|
||||
51.531600743186644
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
[
|
||||
-0.1902008056640625,
|
||||
51.5091698216777
|
||||
],
|
||||
[
|
||||
-0.1888275146484375,
|
||||
51.50147667659363
|
||||
],
|
||||
[
|
||||
-0.15071868896484375,
|
||||
51.503186376638006
|
||||
],
|
||||
[
|
||||
-0.1599884033203125,
|
||||
51.51322956905176
|
||||
],
|
||||
[
|
||||
-0.1902008056640625,
|
||||
51.5091698216777
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
[
|
||||
-0.16582489013671875,
|
||||
51.4811690848672
|
||||
],
|
||||
[
|
||||
-0.1635932922363281,
|
||||
51.474861202507434
|
||||
],
|
||||
[
|
||||
-0.14883041381835938,
|
||||
51.47764105478667
|
||||
],
|
||||
[
|
||||
-0.14951705932617188,
|
||||
51.48352095330697
|
||||
],
|
||||
[
|
||||
-0.16582489013671875,
|
||||
51.4811690848672
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
13
test/tests/geoshapes/data/point_museum_of_london.json
Normal file
13
test/tests/geoshapes/data/point_museum_of_london.json
Normal file
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"name": "geopoint for the museum of london",
|
||||
"city": "london",
|
||||
"type": "geoshapes",
|
||||
"description": "geopoint for the museum of london",
|
||||
"region": {
|
||||
"type": "point",
|
||||
"coordinates": [
|
||||
-0.09613037109375,
|
||||
51.51803669675129
|
||||
]
|
||||
}
|
||||
}
|
45
test/tests/geoshapes/data/polygon_cubbonpark.json
Normal file
45
test/tests/geoshapes/data/polygon_cubbonpark.json
Normal file
|
@ -0,0 +1,45 @@
|
|||
{
|
||||
"name": "cubbon park polygon",
|
||||
"city": "bangalore",
|
||||
"type": "geoshapes",
|
||||
"description": "polygon inside cubbon park",
|
||||
"region": {
|
||||
"type": "Polygon",
|
||||
"coordinates": [
|
||||
[
|
||||
[
|
||||
77.58894681930542,
|
||||
12.976498523818783
|
||||
],
|
||||
[
|
||||
77.58677959442139,
|
||||
12.974533005048169
|
||||
],
|
||||
[
|
||||
77.5879168510437,
|
||||
12.971333776381767
|
||||
],
|
||||
[
|
||||
77.58849620819092,
|
||||
12.96800904416803
|
||||
],
|
||||
[
|
||||
77.59371042251587,
|
||||
12.972128359891645
|
||||
],
|
||||
[
|
||||
77.59512662887573,
|
||||
12.973842978816679
|
||||
],
|
||||
[
|
||||
77.59253025054932,
|
||||
12.976853988320428
|
||||
],
|
||||
[
|
||||
77.58894681930542,
|
||||
12.976498523818783
|
||||
]
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
36
test/tests/geoshapes/mapping.json
Normal file
36
test/tests/geoshapes/mapping.json
Normal file
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
"types": {
|
||||
"geoshapes": {
|
||||
"properties": {
|
||||
"name": {
|
||||
"fields": [
|
||||
{
|
||||
"include_term_vectors": true,
|
||||
"include_in_all": true,
|
||||
"index": true,
|
||||
"store": true,
|
||||
"analyzer": "keyword",
|
||||
"type": "text"
|
||||
}
|
||||
],
|
||||
"dynamic": true,
|
||||
"enabled": true
|
||||
},
|
||||
"region": {
|
||||
"fields": [
|
||||
{
|
||||
"include_term_vectors": true,
|
||||
"include_in_all": true,
|
||||
"index": true,
|
||||
"store": true,
|
||||
"type": "geoshape"
|
||||
}
|
||||
],
|
||||
"dynamic": true,
|
||||
"enabled": true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"default_type": "geoshapes"
|
||||
}
|
1500
test/tests/geoshapes/searches.json
Normal file
1500
test/tests/geoshapes/searches.json
Normal file
File diff suppressed because it is too large
Load diff
3
test/tests/phrase/data/a.json
Normal file
3
test/tests/phrase/data/a.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"body": "Twenty Thousand Leagues Under The Sea"
|
||||
}
|
3
test/tests/phrase/data/b.json
Normal file
3
test/tests/phrase/data/b.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"body": ["bad call", "defenseless receiver"]
|
||||
}
|
23
test/tests/phrase/mapping.json
Normal file
23
test/tests/phrase/mapping.json
Normal file
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"types": {
|
||||
"book": {
|
||||
"properties": {
|
||||
"body": {
|
||||
"fields": [
|
||||
{
|
||||
"include_term_vectors": true,
|
||||
"include_in_all": true,
|
||||
"index": true,
|
||||
"store": true,
|
||||
"analyzer": "en",
|
||||
"type": "text"
|
||||
}
|
||||
],
|
||||
"dynamic": true,
|
||||
"enabled": true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"default_type": "book"
|
||||
}
|
417
test/tests/phrase/searches.json
Normal file
417
test/tests/phrase/searches.json
Normal file
|
@ -0,0 +1,417 @@
|
|||
[
|
||||
{
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "body",
|
||||
"match_phrase": "Twenty"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "body",
|
||||
"match_phrase": "Twenty Thousand"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "body",
|
||||
"match_phrase": "Twenty Thousand Leagues"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "body",
|
||||
"match_phrase": "Twenty Thousand Leagues Under"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "body",
|
||||
"match_phrase": "Twenty Thousand Leagues Under the"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "body",
|
||||
"match_phrase": "Twenty Thousand Leagues Under the Sea"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "body",
|
||||
"match_phrase": "Thousand"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "body",
|
||||
"match_phrase": "Thousand Leagues"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "body",
|
||||
"match_phrase": "Thousand Leagues Under"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "body",
|
||||
"match_phrase": "Thousand Leagues Under the"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "body",
|
||||
"match_phrase": "Thousand Leagues Under the Sea"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "body",
|
||||
"match_phrase": "Leagues"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "body",
|
||||
"match_phrase": "Leagues Under"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "body",
|
||||
"match_phrase": "Leagues Under the"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "body",
|
||||
"match_phrase": "Leagues Under the Sea"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "body",
|
||||
"match_phrase": "Under the Sea"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "body",
|
||||
"match_phrase": "the Sea"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "body",
|
||||
"match_phrase": "Sea"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "body",
|
||||
"match_phrase": "bad call"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "b"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "body",
|
||||
"match_phrase": "defenseless receiver"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "b"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "body",
|
||||
"match_phrase": "bad receiver"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 0,
|
||||
"hits": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "multi-phrase terms",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"sort": ["-_score", "_id"],
|
||||
"query": {
|
||||
"field": "body",
|
||||
"terms": [["twenti","thirti"],["thousand"]]
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 1,
|
||||
"hits": [
|
||||
{
|
||||
"id": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
8
test/tests/sort/data/a.json
Normal file
8
test/tests/sort/data/a.json
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"id": "a",
|
||||
"name": "marty",
|
||||
"age": 19,
|
||||
"born": "2014-11-25",
|
||||
"title": "mista",
|
||||
"tags": ["gopher", "belieber"]
|
||||
}
|
8
test/tests/sort/data/b.json
Normal file
8
test/tests/sort/data/b.json
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"id": "b",
|
||||
"name": "steve",
|
||||
"age": 21,
|
||||
"born": "2000-09-11",
|
||||
"title": "zebra",
|
||||
"tags": ["thought-leader", "futurist"]
|
||||
}
|
8
test/tests/sort/data/c.json
Normal file
8
test/tests/sort/data/c.json
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"id": "c",
|
||||
"name": "aster",
|
||||
"age": 21,
|
||||
"born": "1954-02-02",
|
||||
"title": "blogger",
|
||||
"tags": ["red", "blue", "green"]
|
||||
}
|
7
test/tests/sort/data/d.json
Normal file
7
test/tests/sort/data/d.json
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"id": "d",
|
||||
"age": 65,
|
||||
"born": "1978-12-02",
|
||||
"title": "agent d is desperately trying out to be successful rapster!",
|
||||
"tags": ["cats"]
|
||||
}
|
7
test/tests/sort/data/e.json
Normal file
7
test/tests/sort/data/e.json
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"id": "e",
|
||||
"name": "nancy",
|
||||
"born": "1954-10-22",
|
||||
"title": "rapstar nancy rapster",
|
||||
"tags": ["pain"]
|
||||
}
|
7
test/tests/sort/data/f.json
Normal file
7
test/tests/sort/data/f.json
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"id": "f",
|
||||
"name": "frank",
|
||||
"age": 1,
|
||||
"title": "frank the taxman of cb, Rapster!",
|
||||
"tags": ["vitamin","purple"]
|
||||
}
|
3
test/tests/sort/mapping.json
Normal file
3
test/tests/sort/mapping.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
|
||||
}
|
554
test/tests/sort/searches.json
Normal file
554
test/tests/sort/searches.json
Normal file
|
@ -0,0 +1,554 @@
|
|||
[
|
||||
{
|
||||
"comment": "sort by name, ascending",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"query": {
|
||||
"match_all":{}
|
||||
},
|
||||
"sort": ["name"]
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 6,
|
||||
"hits": [
|
||||
{
|
||||
"id": "c"
|
||||
},
|
||||
{
|
||||
"id": "f"
|
||||
},
|
||||
{
|
||||
"id": "a"
|
||||
},
|
||||
{
|
||||
"id": "e"
|
||||
},
|
||||
{
|
||||
"id": "b"
|
||||
},
|
||||
{
|
||||
"id": "d"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "sort by name, descending",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"query": {
|
||||
"match_all":{}
|
||||
},
|
||||
"sort": ["-name"]
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 6,
|
||||
"hits": [
|
||||
{
|
||||
"id": "b"
|
||||
},
|
||||
{
|
||||
"id": "e"
|
||||
},
|
||||
{
|
||||
"id": "a"
|
||||
},
|
||||
{
|
||||
"id": "f"
|
||||
},
|
||||
{
|
||||
"id": "c"
|
||||
},
|
||||
{
|
||||
"id": "d"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "sort by name, descending, missing first",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"query": {
|
||||
"match_all":{}
|
||||
},
|
||||
"sort": [{"by":"field","field":"name","missing":"first","desc":true}]
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 6,
|
||||
"hits": [
|
||||
{
|
||||
"id": "d"
|
||||
},
|
||||
{
|
||||
"id": "b"
|
||||
},
|
||||
{
|
||||
"id": "e"
|
||||
},
|
||||
{
|
||||
"id": "a"
|
||||
},
|
||||
{
|
||||
"id": "f"
|
||||
},
|
||||
{
|
||||
"id": "c"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "sort by age, ascending, _id, ascending",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"query": {
|
||||
"match_all":{}
|
||||
},
|
||||
"sort": ["age", "_id"]
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 6,
|
||||
"hits": [
|
||||
{
|
||||
"id": "f"
|
||||
},
|
||||
{
|
||||
"id": "a"
|
||||
},
|
||||
{
|
||||
"id": "b"
|
||||
},
|
||||
{
|
||||
"id": "c"
|
||||
},
|
||||
{
|
||||
"id": "d"
|
||||
},
|
||||
{
|
||||
"id": "e"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "sort by age, descending, _id, ascending",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"query": {
|
||||
"match_all":{}
|
||||
},
|
||||
"sort": ["-age", "_id"]
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 6,
|
||||
"hits": [
|
||||
{
|
||||
"id": "d"
|
||||
},
|
||||
{
|
||||
"id": "b"
|
||||
},
|
||||
{
|
||||
"id": "c"
|
||||
},
|
||||
{
|
||||
"id": "a"
|
||||
},
|
||||
{
|
||||
"id": "f"
|
||||
},
|
||||
{
|
||||
"id": "e"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "sort by age, descending, missing first, id, ascending",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"query": {
|
||||
"match_all":{}
|
||||
},
|
||||
"sort": [{"by":"field","field":"age","missing":"first","desc":true},{"by":"id","desc":false}]
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 6,
|
||||
"hits": [
|
||||
{
|
||||
"id": "e"
|
||||
},
|
||||
{
|
||||
"id": "d"
|
||||
},
|
||||
{
|
||||
"id": "b"
|
||||
},
|
||||
{
|
||||
"id": "c"
|
||||
},
|
||||
{
|
||||
"id": "a"
|
||||
},
|
||||
{
|
||||
"id": "f"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "sort by born, ascending",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"query": {
|
||||
"match_all":{}
|
||||
},
|
||||
"sort": ["born"]
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 6,
|
||||
"hits": [
|
||||
{
|
||||
"id": "c"
|
||||
},
|
||||
{
|
||||
"id": "e"
|
||||
},
|
||||
{
|
||||
"id": "d"
|
||||
},
|
||||
{
|
||||
"id": "b"
|
||||
},
|
||||
{
|
||||
"id": "a"
|
||||
},
|
||||
{
|
||||
"id": "f"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "sort by born, descending",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"query": {
|
||||
"match_all":{}
|
||||
},
|
||||
"sort": ["-born"]
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 6,
|
||||
"hits": [
|
||||
{
|
||||
"id": "a"
|
||||
},
|
||||
{
|
||||
"id": "b"
|
||||
},
|
||||
{
|
||||
"id": "d"
|
||||
},
|
||||
{
|
||||
"id": "e"
|
||||
},
|
||||
{
|
||||
"id": "c"
|
||||
},
|
||||
{
|
||||
"id": "f"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "sort by born, descending, missing first",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"query": {
|
||||
"match_all":{}
|
||||
},
|
||||
"sort": [{"by":"field","field":"born","missing":"first","desc":true}]
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 6,
|
||||
"hits": [
|
||||
{
|
||||
"id": "f"
|
||||
},
|
||||
{
|
||||
"id": "a"
|
||||
},
|
||||
{
|
||||
"id": "b"
|
||||
},
|
||||
{
|
||||
"id": "d"
|
||||
},
|
||||
{
|
||||
"id": "e"
|
||||
},
|
||||
{
|
||||
"id": "c"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "sort on multi-valued field",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"query": {
|
||||
"match_all":{}
|
||||
},
|
||||
"sort": [{"by":"field","field":"tags","mode":"min"}]
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 6,
|
||||
"hits": [
|
||||
{
|
||||
"id": "a"
|
||||
},
|
||||
{
|
||||
"id": "c"
|
||||
},
|
||||
{
|
||||
"id": "d"
|
||||
},
|
||||
{
|
||||
"id": "b"
|
||||
},
|
||||
{
|
||||
"id": "e"
|
||||
},
|
||||
{
|
||||
"id": "f"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "multi-column sort by age, ascending, name, ascending (flips b and c which have same age)",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"query": {
|
||||
"match_all":{}
|
||||
},
|
||||
"sort": ["age", "name"]
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 6,
|
||||
"hits": [
|
||||
{
|
||||
"id": "f"
|
||||
},
|
||||
{
|
||||
"id": "a"
|
||||
},
|
||||
{
|
||||
"id": "c"
|
||||
},
|
||||
{
|
||||
"id": "b"
|
||||
},
|
||||
{
|
||||
"id": "d"
|
||||
},
|
||||
{
|
||||
"id": "e"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "sort by docid descending",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"query": {
|
||||
"match_all":{}
|
||||
},
|
||||
"sort": ["-_id"]
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 6,
|
||||
"hits": [
|
||||
{
|
||||
"id": "f"
|
||||
},
|
||||
{
|
||||
"id": "e"
|
||||
},
|
||||
{
|
||||
"id": "d"
|
||||
},
|
||||
{
|
||||
"id": "c"
|
||||
},
|
||||
{
|
||||
"id": "b"
|
||||
},
|
||||
{
|
||||
"id": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "sort by name, ascending, after marty",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"query": {
|
||||
"match_all":{}
|
||||
},
|
||||
"sort": ["name"],
|
||||
"search_after": ["marty"]
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 6,
|
||||
"hits": [
|
||||
{
|
||||
"id": "e"
|
||||
},
|
||||
{
|
||||
"id": "b"
|
||||
},
|
||||
{
|
||||
"id": "d"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "sort by name, ascending, before nancy",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"query": {
|
||||
"match_all":{}
|
||||
},
|
||||
"sort": ["name"],
|
||||
"search_before": ["nancy"]
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 6,
|
||||
"hits": [
|
||||
{
|
||||
"id": "c"
|
||||
},
|
||||
{
|
||||
"id": "f"
|
||||
},
|
||||
{
|
||||
"id": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "sort by ID, after doc d",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"query": {
|
||||
"match_all":{}
|
||||
},
|
||||
"sort": ["_id"],
|
||||
"search_after": ["d"]
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 6,
|
||||
"hits": [
|
||||
{
|
||||
"id": "e"
|
||||
},
|
||||
{
|
||||
"id": "f"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "sort by ID, before doc d",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"query": {
|
||||
"match_all":{}
|
||||
},
|
||||
"sort": ["_id"],
|
||||
"search_before": ["d"]
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 6,
|
||||
"hits": [
|
||||
{
|
||||
"id": "a"
|
||||
},
|
||||
{
|
||||
"id": "b"
|
||||
},
|
||||
{
|
||||
"id": "c"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "sort by score, after score 0.286889[ e(299646) > f(286889) > d(222224)]",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"query": {
|
||||
"query":"rapster"
|
||||
},
|
||||
"sort": ["_score"],
|
||||
"search_after": ["0.286889"]
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 3,
|
||||
"hits": [
|
||||
{
|
||||
"id": "f"
|
||||
},
|
||||
{
|
||||
"id": "e"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "sort by score, before score f/0.286889[ e(299646) > f(286889) > d(222224)]",
|
||||
"search": {
|
||||
"from": 0,
|
||||
"size": 10,
|
||||
"query": {
|
||||
"query":"rapster"
|
||||
},
|
||||
"sort": ["_score"],
|
||||
"search_before": ["0.286889"]
|
||||
},
|
||||
"result": {
|
||||
"total_hits": 3,
|
||||
"hits": [
|
||||
{
|
||||
"id": "d"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue