forked from opensearch-project/opensearch-api-specification
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed /_search/scroll/{scroll_id}, missing search tests. (opensearch-…
…project#732) * Fixed /_search/scroll. Signed-off-by: dblock <[email protected]> * Added tests for GET and POST /_search. Signed-off-by: dblock <[email protected]> * Added a test for GET /_search/pipeline and DELETE /_search/pipeline/{id}. Signed-off-by: dblock <[email protected]> * Added missing _search/point_in_time tests. Signed-off-by: dblock <[email protected]> --------- Signed-off-by: dblock <[email protected]> Signed-off-by: Nathalie Jonathan <[email protected]>
- Loading branch information
1 parent
e2b2879
commit d989004
Showing
10 changed files
with
301 additions
and
13 deletions.
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
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
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,33 @@ | ||
$schema: ../../../../json_schemas/test_story.schema.yaml | ||
|
||
description: Test point-in-time. | ||
version: '>= 2.4' | ||
epilogues: | ||
- path: /_search/point_in_time/_all | ||
method: DELETE | ||
- path: /movies | ||
method: DELETE | ||
status: [200, 404] | ||
prologues: | ||
- path: /_bulk | ||
method: POST | ||
parameters: | ||
refresh: true | ||
request: | ||
content_type: application/x-ndjson | ||
payload: | ||
- {create: {_index: movies}} | ||
- {title: The Cruise, year: 1998} | ||
- {create: {_index: movies}} | ||
- {title: Drive, year: 1960} | ||
- path: /movies/_search/point_in_time | ||
method: POST | ||
parameters: | ||
keep_alive: 1m | ||
chapters: | ||
- synopsis: Get all point in time. | ||
path: /_search/point_in_time/_all | ||
method: GET | ||
- synopsis: Delete all point in time. | ||
path: /_search/point_in_time/_all | ||
method: DELETE |
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,19 @@ | ||
$schema: ../../../json_schemas/test_story.schema.yaml | ||
|
||
description: Test search. | ||
chapters: | ||
- synopsis: Search across all indexes (GET). | ||
path: /_search | ||
method: GET | ||
request: | ||
payload: | ||
query: | ||
match_all: {} | ||
- synopsis: Search across all indexes (POST). | ||
path: /_search | ||
method: POST | ||
request: | ||
payload: | ||
query: | ||
match_all: {} | ||
|
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,33 @@ | ||
$schema: ../../../../json_schemas/test_story.schema.yaml | ||
|
||
description: Test the creation of a search pipeline. | ||
version: '>= 2.9' | ||
epilogues: | ||
- path: /_search/pipeline/empty-pipeline | ||
method: DELETE | ||
status: [200, 404] | ||
chapters: | ||
- synopsis: Create search pipeline. | ||
path: /_search/pipeline/{id} | ||
method: PUT | ||
parameters: | ||
id: empty-pipeline | ||
request: | ||
payload: {} | ||
response: | ||
status: 200 | ||
payload: | ||
acknowledged: true | ||
- synopsis: Query all pipelines. | ||
path: /_search/pipeline | ||
method: GET | ||
- synopsis: Query created pipeline. | ||
path: /_search/pipeline/{id} | ||
method: GET | ||
parameters: | ||
id: empty-pipeline | ||
- synopsis: Delete created pipeline. | ||
path: /_search/pipeline/{id} | ||
method: DELETE | ||
parameters: | ||
id: empty-pipeline |
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
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,37 @@ | ||
$schema: ../../../../json_schemas/test_story.schema.yaml | ||
|
||
description: Test point-in-time. | ||
version: '>= 2.4' | ||
epilogues: | ||
- path: /_search/point_in_time/_all | ||
method: DELETE | ||
- path: /movies | ||
method: DELETE | ||
status: [200, 404] | ||
prologues: | ||
- path: /_bulk | ||
method: POST | ||
parameters: | ||
refresh: true | ||
request: | ||
content_type: application/x-ndjson | ||
payload: | ||
- {create: {_index: movies}} | ||
- {title: The Cruise, year: 1998} | ||
- {create: {_index: movies}} | ||
- {title: Drive, year: 1960} | ||
- path: /movies/_search/point_in_time | ||
id: pit | ||
method: POST | ||
parameters: | ||
keep_alive: 1m | ||
output: | ||
id: payload.pit_id | ||
chapters: | ||
- synopsis: Delete all pits. | ||
path: /_search/point_in_time | ||
request: | ||
payload: | ||
pit_id: | ||
- ${pit.id} | ||
method: DELETE |
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,107 @@ | ||
$schema: ../../../../json_schemas/test_story.schema.yaml | ||
|
||
description: Test search scroll. | ||
prologues: | ||
- path: /_bulk | ||
method: POST | ||
parameters: | ||
refresh: true | ||
request: | ||
content_type: application/x-ndjson | ||
payload: | ||
- {create: {_index: movies}} | ||
- {title: The Lion King, year: 1994} | ||
- {create: {_index: movies}} | ||
- {title: Drive, year: 2011} | ||
- {create: {_index: movies}} | ||
- {title: Frozen, year: 2013} | ||
- {create: {_index: movies}} | ||
- {title: Moneyball, year: 2011} | ||
- {create: {_index: movies}} | ||
- {title: The Cruise, year: 1998} | ||
- path: /movies/_search | ||
method: GET | ||
id: scroll | ||
parameters: | ||
scroll: 10m | ||
request: | ||
payload: | ||
query: | ||
match_all: {} | ||
size: 1 | ||
output: | ||
scroll_id: payload._scroll_id | ||
epilogues: | ||
- path: /_search/scroll/_all | ||
method: DELETE | ||
- path: /movies | ||
method: DELETE | ||
status: [200, 404] | ||
chapters: | ||
- synopsis: Get the next batch of results (GET). | ||
method: GET | ||
path: /_search/scroll | ||
request: | ||
payload: | ||
scroll: 10m | ||
scroll_id: ${scroll.scroll_id} | ||
response: | ||
status: 200 | ||
payload: | ||
hits: | ||
hits: | ||
- _index: movies | ||
_source: | ||
title: Drive | ||
- synopsis: Get the next batch of results (POST). | ||
method: POST | ||
path: /_search/scroll | ||
request: | ||
payload: | ||
scroll: 10m | ||
scroll_id: ${scroll.scroll_id} | ||
response: | ||
status: 200 | ||
payload: | ||
hits: | ||
hits: | ||
- _index: movies | ||
_source: | ||
title: Frozen | ||
- synopsis: Get the next batch of results (GET). | ||
method: GET | ||
path: /_search/scroll/{scroll_id} | ||
parameters: | ||
scroll_id: ${scroll.scroll_id} | ||
request: | ||
payload: | ||
scroll: 10m | ||
response: | ||
status: 200 | ||
payload: | ||
hits: | ||
hits: | ||
- _index: movies | ||
_source: | ||
title: Moneyball | ||
- synopsis: Get the next batch of results (POST). | ||
method: POST | ||
path: /_search/scroll/{scroll_id} | ||
parameters: | ||
scroll_id: ${scroll.scroll_id} | ||
request: | ||
payload: | ||
scroll: 10m | ||
response: | ||
status: 200 | ||
payload: | ||
hits: | ||
hits: | ||
- _index: movies | ||
_source: | ||
title: The Cruise | ||
- synopsis: Delete the scroll. | ||
method: DELETE | ||
path: /_search/scroll/{scroll_id} | ||
parameters: | ||
scroll_id: ${scroll.scroll_id} |
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,38 @@ | ||
$schema: ../../../json_schemas/test_story.schema.yaml | ||
|
||
description: Test search. | ||
prologues: | ||
- path: /_bulk | ||
method: POST | ||
parameters: | ||
refresh: true | ||
request: | ||
content_type: application/x-ndjson | ||
payload: | ||
- {create: {_index: movies, _id: movie1}} | ||
- {director: Quentin Tarantino, title: Pulp Fiction, year: 1994} | ||
- {create: {_index: movies, _id: movie2}} | ||
- {director: Christopher Nolan, title: Inception, year: 2010} | ||
epilogues: | ||
- path: /movies | ||
method: DELETE | ||
status: [200, 404] | ||
chapters: | ||
- synopsis: Search in an index (GET). | ||
path: /{index}/_search | ||
method: GET | ||
parameters: | ||
index: movies | ||
request: | ||
payload: | ||
query: | ||
match_all: {} | ||
- synopsis: Search across all indices (POST). | ||
path: /{index}/_search | ||
method: POST | ||
parameters: | ||
index: movies | ||
request: | ||
payload: | ||
query: | ||
match_all: {} |
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,30 @@ | ||
$schema: ../../../../json_schemas/test_story.schema.yaml | ||
|
||
description: Test point-in-time. | ||
version: '>= 2.4' | ||
epilogues: | ||
- path: /_search/point_in_time/_all | ||
method: DELETE | ||
- path: /movies | ||
method: DELETE | ||
status: [200, 404] | ||
prologues: | ||
- path: /_bulk | ||
method: POST | ||
parameters: | ||
refresh: true | ||
request: | ||
content_type: application/x-ndjson | ||
payload: | ||
- {create: {_index: movies}} | ||
- {title: The Cruise, year: 1998} | ||
- {create: {_index: movies}} | ||
- {title: Drive, year: 1960} | ||
chapters: | ||
- synopsis: Create a point in time. | ||
path: /{index}/_search/point_in_time | ||
method: POST | ||
parameters: | ||
index: | ||
- movies | ||
keep_alive: 1m |