-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added rest_total_hits_as_int test for _search (#466)
* Added rest_total_hits_as_int test for _search Signed-off-by: Andy Wick <[email protected]> * change request_body to request Signed-off-by: Andy Wick <[email protected]> * Not gonna fight the linter Signed-off-by: Andy Wick <[email protected]> * Add "Refn" to .cspell and back to test Signed-off-by: Andy Wick <[email protected]> --------- Signed-off-by: Andy Wick <[email protected]>
- Loading branch information
Showing
2 changed files
with
127 additions
and
1 deletion.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -183,4 +183,5 @@ urldecode | |
vectory | ||
whoamiprotected | ||
wordnet | ||
Yrtsd | ||
Yrtsd | ||
Refn |
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,125 @@ | ||
$schema: ../../../json_schemas/test_story.schema.yaml | ||
|
||
description: Test search endpoint with rest_total_hits_as_int. | ||
prologues: | ||
- path: /movies/_doc | ||
method: POST | ||
parameters: | ||
refresh: true | ||
request: | ||
payload: | ||
director: Bennett Miller | ||
title: Moneyball | ||
year: 2011 | ||
status: [201] | ||
- path: /movies/_doc | ||
method: POST | ||
parameters: | ||
refresh: true | ||
request: | ||
payload: | ||
director: Nicolas Winding Refn | ||
title: Drive | ||
year: 2011 | ||
status: [201] | ||
epilogues: | ||
- path: /movies | ||
method: DELETE | ||
status: [200, 404] | ||
chapters: | ||
- synopsis: Search with rest_total_hits_as_int=true. | ||
path: /{index}/_search | ||
parameters: | ||
index: movies | ||
rest_total_hits_as_int: true | ||
method: POST | ||
request: | ||
payload: | ||
query: | ||
match_all: {} | ||
response: | ||
status: 200 | ||
payload: | ||
timed_out: false | ||
hits: | ||
total: 2 | ||
max_score: 1 | ||
hits: | ||
- _index: movies | ||
_score: 1 | ||
_source: | ||
director: Bennett Miller | ||
title: Moneyball | ||
year: 2011 | ||
- _index: movies | ||
_score: 1 | ||
_source: | ||
director: Nicolas Winding Refn | ||
title: Drive | ||
year: 2011 | ||
- synopsis: Search with rest_total_hits_as_int=false. | ||
path: /{index}/_search | ||
parameters: | ||
index: movies | ||
rest_total_hits_as_int: false | ||
method: POST | ||
request: | ||
payload: | ||
query: | ||
match_all: {} | ||
response: | ||
status: 200 | ||
payload: | ||
timed_out: false | ||
hits: | ||
total: | ||
value: 2 | ||
relation: eq | ||
max_score: 1 | ||
hits: | ||
- _index: movies | ||
_score: 1 | ||
_source: | ||
director: Bennett Miller | ||
title: Moneyball | ||
year: 2011 | ||
- _index: movies | ||
_score: 1 | ||
_source: | ||
director: Nicolas Winding Refn | ||
title: Drive | ||
year: 2011 | ||
- synopsis: Search with rest_total_hits_as_int=false track_total_hits=1. | ||
path: /{index}/_search | ||
parameters: | ||
index: movies | ||
rest_total_hits_as_int: false | ||
method: POST | ||
request: | ||
payload: | ||
track_total_hits: 1 | ||
query: | ||
match_all: {} | ||
response: | ||
status: 200 | ||
payload: | ||
timed_out: false | ||
hits: | ||
total: | ||
value: 1 | ||
relation: gte | ||
max_score: 1 | ||
hits: | ||
- _index: movies | ||
_score: 1 | ||
_source: | ||
director: Bennett Miller | ||
title: Moneyball | ||
year: 2011 | ||
- _index: movies | ||
_score: 1 | ||
_source: | ||
director: Nicolas Winding Refn | ||
title: Drive | ||
year: 2011 | ||
|