Skip to content

Commit

Permalink
Adding more tests for desc order sort
Browse files Browse the repository at this point in the history
Signed-off-by: Chaitanya Gohel <[email protected]>
  • Loading branch information
gashutos committed Nov 7, 2023
1 parent d4715bd commit 54baa7e
Showing 1 changed file with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,22 @@
{"index":{}}
{"population": 164.4}
- do:
search:
index: test
rest_total_hits_as_int: true
body:
size: 3
sort: [ { population: desc } ]
- match: { hits.total: 5 }
- length: { hits.hits: 3 }
- match: { hits.hits.0._index: test }
- match: { hits.hits.0._source.population: 194.4 }
- match: { hits.hits.1._index: test }
- match: { hits.hits.1._source.population: 184.4 }
- match: { hits.hits.2._index: test }
- match: { hits.hits.2._source.population: 174.4 }

- do:
search:
index: test
Expand All @@ -375,7 +391,7 @@
body:
size: 1
sort: [ { population: asc } ]
search_after: [ 184.4 ]
search_after: [ 184.375 ] # this is ruonded sort value in sort result
- match: { hits.total: 5 }
- length: { hits.hits: 1 }
- match: { hits.hits.0._index: test }
Expand All @@ -389,11 +405,11 @@
body:
size: 1
sort: [ { population: desc } ]
search_after: [ 164.4 ]
search_after: [ 164.375 ] # this is rounded sort value in sort result
- match: { hits.total: 5 }
- length: { hits.hits: 1 }
- match: { hits.hits.0._index: test }
- match: { hits.hits.0._source.population: 164.4 }
- match: { hits.hits.0._source.population: 144.4 }

# search_after with the asc sort with missing
- do:
Expand Down

0 comments on commit 54baa7e

Please sign in to comment.