Skip to content
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

Adds async search API request and response examples #2780

Merged
merged 5 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions docs/overlays/elasticsearch-serverless-openapi-overlays.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,24 @@ actions:
**Technical preview**
This functionality is in technical preview and may be changed or removed in a future release.
Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.
- target: "$.components['requestBodies']['async_search.submit']"
description: "Add example for asynch search submit request"
update:
content:
application/json:
examples:
asyncSearchSubmitResponseExample1:
$ref: "../../specification/async_search/submit/AsyncSearchSubmitRequestExample1.json"
- target: "$.components['responses']['async_search.submit#200']"
description: "Add example for asynch search submit response"
update:
content:
application/json:
examples:
asyncSearchSubmitResponseExample1:
$ref: "../../specification/async_search/submit/AsyncSearchSubmitResponseExample1.json"
- target: "$.paths['/_transform/{transform_id}']['put']"
description: "Update create transform operation"
description: "Add examples for create transform operation"
update:
requestBody:
content:
Expand All @@ -29,5 +45,3 @@ actions:
examples:
createTransformResponseExample1:
$ref: "../../specification/transform/put_transform/examples/200_response/PutTransformResponseExample1.json"


Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"summary": "A succesful response when retrieving the results of a previously submitted async search request given its identifier.",
"description": "",
"type": "response",
"response_code": 200,
"value": "{\n \"id\" : \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n \"is_partial\" : false, <1>\n \"is_running\" : false, <2>\n \"start_time_in_millis\" : 1583945890986,\n \"expiration_time_in_millis\" : 1584377890986, <3>\n \"completion_time_in_millis\" : 1583945903130, <4>\n \"response\" : {\n \"took\" : 12144,\n \"timed_out\" : false,\n \"num_reduce_phases\" : 46, <5>\n \"_shards\" : {\n \"total\" : 562,\n \"successful\" : 188, <6>\n \"skipped\" : 0,\n \"failed\" : 0\n },\n \"hits\" : {\n \"total\" : {\n \"value\" : 456433,\n \"relation\" : \"eq\"\n },\n \"max_score\" : null,\n \"hits\" : [ ]\n },\n \"aggregations\" : { <7>\n \"sale_date\" : {\n \"buckets\" : []\n }\n }\n }\n}"
}
szabosteve marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"summary": "A succesful response when retrieving the status of a previously submitted and completed async search without the results.",
"description": "For an async search that has been completed, the status response has an additional `completion_status` field that shows the status code of the completed async search which was – in this case – a success.",
"type": "response",
"response_code": 200,
"value": "{\n \"id\" : \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n \"is_running\" : false,\n \"is_partial\" : false,\n \"start_time_in_millis\" : 1583945890986,\n \"expiration_time_in_millis\" : 1584377890986,\n \"_shards\" : {\n \"total\" : 562,\n \"successful\" : 562,\n \"skipped\" : 0,\n \"failed\" : 0\n },\n \"completion_status\" : 200 <1>\n}"
szabosteve marked this conversation as resolved.
Show resolved Hide resolved
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"summary": "A succesful response when retrieving the status of a previously submitted and completed async search without the results.",
"description": "For an async search that has been completed, the status response has an additional `completion_status` field that shows the status code of the completed async search which was completed – in this case – with an error.",
"type": "response",
"response_code": 200,
"value": "{\n \"id\" : \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n \"is_running\" : false,\n \"is_partial\" : true,\n \"start_time_in_millis\" : 1583945890986,\n \"expiration_time_in_millis\" : 1584377890986,\n \"_shards\" : {\n \"total\" : 562,\n \"successful\" : 450,\n \"skipped\" : 0,\n \"failed\" : 112\n },\n \"completion_status\" : 503 <1>\n}"
}
szabosteve marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"summary": "A succesful response when retrieving the status of a previously submitted async search without the results.",
"description": "",
"type": "response",
"response_code": 200,
"value": "{\n \"id\" : \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n \"is_running\" : true,\n \"is_partial\" : true,\n \"start_time_in_millis\" : 1583945890986,\n \"expiration_time_in_millis\" : 1584377890986,\n \"_shards\" : {\n \"total\" : 562,\n \"successful\" : 188, <1>\n \"skipped\" : 0,\n \"failed\" : 0\n }\n}"
}
szabosteve marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"summary": "Performs a search request asynchronously.",
"method_request": "POST /sales*/_async_search?size=0",
"description": "Accepts the same parameters and request body as the search API.",
"type": "request",
"value": "{\n \"sort\": [\n { \"date\": { \"order\": \"asc\" } }\n ],\n \"aggs\": {\n \"sale_date\": {\n \"date_histogram\": {\n \"field\": \"date\",\n \"calendar_interval\": \"1d\"\n }\n }\n }\n}"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"summary": "A successful response when performing search asynchronously.",
"description": "",
"type": "response",
"response_code": 200,
"value": "{\n \"id\" : \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\", <1>\n \"is_partial\" : true, <2>\n \"is_running\" : true, <3>\n \"start_time_in_millis\" : 1583945890986,\n \"expiration_time_in_millis\" : 1584377890986,\n \"response\" : {\n \"took\" : 1122,\n \"timed_out\" : false,\n \"num_reduce_phases\" : 0,\n \"_shards\" : {\n \"total\" : 562, <4>\n \"successful\" : 3, <5>\n \"skipped\" : 0,\n \"failed\" : 0\n },\n \"hits\" : {\n \"total\" : {\n \"value\" : 157483, <6>\n \"relation\" : \"gte\"\n },\n \"max_score\" : null,\n \"hits\" : [ ]\n }\n }\n}"
szabosteve marked this conversation as resolved.
Show resolved Hide resolved
}
szabosteve marked this conversation as resolved.
Show resolved Hide resolved