Skip to content

Commit

Permalink
Added tests for GET and POST /_search.
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <[email protected]>
  • Loading branch information
dblock committed Dec 13, 2024
1 parent caa8b35 commit 9fd6010
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/default/_core/search.yaml
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: {}

39 changes: 39 additions & 0 deletions tests/default/indices/search.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
$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: {}

0 comments on commit 9fd6010

Please sign in to comment.