-
Notifications
You must be signed in to change notification settings - Fork 90
Msearch template API tests #735
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
0b51d02
5d15786
54cd734
9d4b1b8
b377b37
7effb63
5666d68
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,9 @@ components: | |
The value is the variable value. | ||
type: object | ||
additionalProperties: | ||
type: object | ||
oneOf: | ||
- type: string | ||
- type: object | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's an example where this is a string? The description says these are key/value pairs. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it's a key-value pair. Here’s one example: link. Initially, it seems there was an expectation that the value would be in the form of an object, but I demonstrated with an example that it can also be a string. |
||
profile: | ||
description: When `true`, provides a profile for the query execution. | ||
type: boolean | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
$schema: ../../../json_schemas/test_story.schema.yaml | ||
Tokesh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
description: Test _termvectors and _msearch/template APIs. | ||
prologues: | ||
- path: /_bulk | ||
method: POST | ||
parameters: | ||
refresh: true | ||
request: | ||
content_type: application/x-ndjson | ||
payload: | ||
- {create: {_index: books, _id: book1}} | ||
- {author: Harper Lee, title: To Kill a Mockingbird, year: 1960} | ||
- {create: {_index: books, _id: book2}} | ||
- {author: Elizabeth Rudnick, title: Beauty and the Beast, year: 1991} | ||
- {create: {_index: books, _id: book3}} | ||
- {author: George Orwell, title: '1984', year: 1949} | ||
epilogues: | ||
- path: /books | ||
method: DELETE | ||
status: [200, 404] | ||
|
||
chapters: | ||
- synopsis: Perform a multi-search template query using a GET request. | ||
path: /_msearch/template | ||
method: GET | ||
Tokesh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
request: | ||
content_type: application/x-ndjson | ||
payload: | ||
- {index: books} | ||
- {source: '{"query": {"match": {"title": "{{title}}"}}}', params: {title: Mockingbird}} | ||
- {index: books} | ||
- {source: '{"query": {"match": {"title": "{{title}}"}}}', params: {title: Beast}} | ||
response: | ||
status: 200 | ||
- synopsis: Perform a multi-search template query using a POST request. | ||
path: /_msearch/template | ||
method: POST | ||
request: | ||
content_type: application/x-ndjson | ||
payload: | ||
- {index: books} | ||
- {source: '{"query": {"match": {"title": "{{title}}"}}}', params: {title: '1984'}} | ||
- {index: books} | ||
- {source: '{"query": {"match": {"author": "{{author}}"}}}', params: {author: Harper Lee}} | ||
response: | ||
status: 200 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
$schema: ../../../json_schemas/test_story.schema.yaml | ||
Tokesh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
description: Test _termvectors and _msearch/template APIs. | ||
prologues: | ||
- path: /_bulk | ||
method: POST | ||
parameters: | ||
refresh: true | ||
request: | ||
content_type: application/x-ndjson | ||
payload: | ||
- {create: {_index: books, _id: book1}} | ||
- {author: Harper Lee, title: To Kill a Mockingbird, year: 1960} | ||
- {create: {_index: books, _id: book2}} | ||
- {author: Elizabeth Rudnick, title: Beauty and the Beast, year: 1991} | ||
- {create: {_index: books, _id: book3}} | ||
- {author: George Orwell, title: '1984', year: 1949} | ||
epilogues: | ||
- path: /books | ||
method: DELETE | ||
status: [200, 404] | ||
|
||
chapters: | ||
- synopsis: Perform a multi-search template query using a GET request. | ||
path: /{index}/_msearch/template | ||
parameters: | ||
index: books | ||
method: GET | ||
request: | ||
content_type: application/x-ndjson | ||
payload: | ||
- {index: books} | ||
- {source: '{"query": {"match": {"title": "{{title}}"}}}', params: {title: Mockingbird}} | ||
- {index: books} | ||
- {source: '{"query": {"match": {"title": "{{title}}"}}}', params: {title: Beast}} | ||
response: | ||
status: 200 | ||
- synopsis: Perform a multi-search template query using a POST request. | ||
path: /{index}/_msearch/template | ||
parameters: | ||
index: books | ||
method: POST | ||
request: | ||
content_type: application/x-ndjson | ||
payload: | ||
- {index: books} | ||
- {source: '{"query": {"match": {"title": "{{title}}"}}}', params: {title: '1984'}} | ||
- {index: books} | ||
- {source: '{"query": {"match": {"author": "{{author}}"}}}', params: {author: Harper Lee}} | ||
response: | ||
Tokesh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
status: 200 |
Uh oh!
There was an error while loading. Please reload this page.