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
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