-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Andriy Redko <[email protected]>
- Loading branch information
1 parent
0e58cf2
commit b1f8f7a
Showing
2 changed files
with
135 additions
and
0 deletions.
There are no files selected for viewing
61 changes: 61 additions & 0 deletions
61
rest-api-spec/src/main/resources/rest-api-spec/test/search/280_unsigned_long.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
setup: | ||
- do: | ||
indices.create: | ||
index: unsigned_long_sort | ||
body: | ||
settings: | ||
number_of_shards: 3 | ||
number_of_replicas: 0 | ||
mappings: | ||
properties: | ||
field: | ||
type: unsigned_long | ||
|
||
--- | ||
"test sorting against unsigned_long only fields": | ||
- skip: | ||
version: " - 2.19.99" | ||
reason: "this change is added in 3.0.0" | ||
|
||
- do: | ||
bulk: | ||
refresh: true | ||
body: | ||
- '{ "index" : { "_index" : "unsigned_long_sort", "_id" : "1" } }' | ||
- '{"field" : [ 13835058055282163712, 1 ] }' | ||
- '{ "index" : { "_index" : "unsigned_long_sort", "_id" : "2" } }' | ||
- '{"field" : [ 13835058055282163713, 2 ] }' | ||
- '{ "index" : { "_index" : "unsigned_long_sort", "_id" : "3" } }' | ||
- '{"field" : [ 13835058055282163714, 3 ] }' | ||
|
||
- do: | ||
search: | ||
index: unsigned_long_sort | ||
body: | ||
size: 5 | ||
sort: [{ field: { mode: max, order: desc } } ] | ||
- match: {hits.total.value: 3 } | ||
- length: {hits.hits: 3 } | ||
- match: { hits.hits.0._index: unsigned_long_sort } | ||
- match: { hits.hits.0._source.field: [ 13835058055282163714, 3 ] } | ||
- match: { hits.hits.0.sort: [ 13835058055282163714 ] } | ||
- match: { hits.hits.1._source.field: [ 13835058055282163713, 2 ] } | ||
- match: { hits.hits.1.sort: [ 13835058055282163713 ] } | ||
- match: { hits.hits.2._source.field: [ 13835058055282163712, 1 ] } | ||
- match: { hits.hits.2.sort: [ 13835058055282163712 ] } | ||
|
||
- do: | ||
search: | ||
index: unsigned_long_sort | ||
body: | ||
size: 5 | ||
sort: [{ field: { mode: max, order: asc } } ] | ||
- match: {hits.total.value: 3 } | ||
- length: {hits.hits: 3 } | ||
- match: { hits.hits.0._index: unsigned_long_sort } | ||
- match: { hits.hits.0._source.field: [ 13835058055282163712, 1 ] } | ||
- match: { hits.hits.0.sort: [ 13835058055282163712 ] } | ||
- match: { hits.hits.1._source.field: [ 13835058055282163713, 2 ] } | ||
- match: { hits.hits.1.sort: [ 13835058055282163713 ] } | ||
- match: { hits.hits.2._source.field: [ 13835058055282163714, 3 ] } | ||
- match: { hits.hits.2.sort: [ 13835058055282163714 ] } |
74 changes: 74 additions & 0 deletions
74
rest-api-spec/src/main/resources/rest-api-spec/test/search/290_long.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
setup: | ||
- do: | ||
indices.create: | ||
index: long_sort | ||
body: | ||
settings: | ||
number_of_shards: 3 | ||
number_of_replicas: 0 | ||
mappings: | ||
properties: | ||
field: | ||
type: long | ||
|
||
--- | ||
"test sorting against long only fields": | ||
|
||
- do: | ||
bulk: | ||
refresh: true | ||
body: | ||
- '{ "index" : { "_index" : "long_sort", "_id" : "1" } }' | ||
- '{"field" : [ 55282163712, 1 ] }' | ||
- '{ "index" : { "_index" : "long_sort", "_id" : "2" } }' | ||
- '{"field" : [ 55282163713, 2 ] }' | ||
- '{ "index" : { "_index" : "long_sort", "_id" : "3" } }' | ||
- '{"field" : [ 55282163714, 3 ] }' | ||
|
||
- do: | ||
search: | ||
index: long_sort | ||
body: | ||
size: 5 | ||
sort: [{ field: { mode: max, order: desc } } ] | ||
- match: {hits.total.value: 3 } | ||
- length: {hits.hits: 3 } | ||
- match: { hits.hits.0._index: long_sort } | ||
- match: { hits.hits.0._source.field: [ 55282163714, 3 ] } | ||
- match: { hits.hits.0.sort: [ 55282163714 ] } | ||
- match: { hits.hits.1._source.field: [ 55282163713, 2 ] } | ||
- match: { hits.hits.1.sort: [ 55282163713 ] } | ||
- match: { hits.hits.2._source.field: [ 55282163712, 1 ] } | ||
- match: { hits.hits.2.sort: [ 55282163712 ] } | ||
|
||
- do: | ||
search: | ||
index: long_sort | ||
body: | ||
size: 5 | ||
sort: [{ field: { mode: min, order: desc } } ] | ||
- match: {hits.total.value: 3 } | ||
- length: {hits.hits: 3 } | ||
- match: { hits.hits.0._index: long_sort } | ||
- match: { hits.hits.0._source.field: [ 55282163714, 3 ] } | ||
- match: { hits.hits.0.sort: [ 3 ] } | ||
- match: { hits.hits.1._source.field: [ 55282163713, 2 ] } | ||
- match: { hits.hits.1.sort: [ 2 ] } | ||
- match: { hits.hits.2._source.field: [ 55282163712, 1 ] } | ||
- match: { hits.hits.2.sort: [ 1 ] } | ||
|
||
- do: | ||
search: | ||
index: long_sort | ||
body: | ||
size: 5 | ||
sort: [{ field: { mode: max, order: asc } } ] | ||
- match: {hits.total.value: 3 } | ||
- length: {hits.hits: 3 } | ||
- match: { hits.hits.0._index: long_sort } | ||
- match: { hits.hits.0._source.field: [ 55282163712, 1 ] } | ||
- match: { hits.hits.0.sort: [ 55282163712 ] } | ||
- match: { hits.hits.1._source.field: [ 55282163713, 2 ] } | ||
- match: { hits.hits.1.sort: [ 55282163713 ] } | ||
- match: { hits.hits.2._source.field: [ 55282163714, 3 ] } | ||
- match: { hits.hits.2.sort: [ 55282163714 ] } |