[DOCS] add docs for async search (#53675)

Relates to #49091

Co-Authored-By: James Rodewig <james.rodewig@elastic.co>
This commit is contained in:
Luca Cavanna 2020-03-20 14:04:33 +01:00
parent 6c57681446
commit 03fca61fcb
12 changed files with 509768 additions and 199 deletions

View File

@ -307,10 +307,7 @@ class RestTestsFromSnippetsTask extends SnippetsTask {
if (path == null) {
path = '' // Catch requests to the root...
} else {
// Escape some characters that are also escaped by sense
path = path.replace('<', '%3C').replace('>', '%3E')
path = path.replace('{', '%7B').replace('}', '%7D')
path = path.replace('|', '%7C')
}
current.println(" - do:")
if (catchPart != null) {

View File

@ -87,7 +87,7 @@ GET /%3Clogstash-%7Bnow%2Fd%7D%3E/_search
}
----------------------------------------------------------------------
// TEST[s/^/PUT logstash-2016.09.20\n/]
// TEST[s/now/2016.09.20||/]
// TEST[s/now/2016.09.20%7C%7C/]
[NOTE]
.Percent encoding of date math characters
@ -141,7 +141,7 @@ GET /%3Clogstash-%7Bnow%2Fd-2d%7D%3E%2C%3Clogstash-%7Bnow%2Fd-1d%7D%3E%2C%3Clogs
}
----------------------------------------------------------------------
// TEST[s/^/PUT logstash-2016.09.20\nPUT logstash-2016.09.19\nPUT logstash-2016.09.18\n/]
// TEST[s/now/2016.09.20||/]
// TEST[s/now/2016.09.20%7C%7C/]
[[common-options]]
=== Common options
@ -367,7 +367,7 @@ GET /_search?filter_path=hits.hits._source&_source=title&sort=rating:desc
[float]
==== Flat Settings
The `flat_settings` flag affects rendering of the lists of settings. When the
The `flat_settings` flag affects rendering of the lists of settings. When the
`flat_settings` flag is `true`, settings are returned in a flat format:
[source,console]

View File

@ -0,0 +1,22 @@
[role="xpack"]
[testenv="basic"]
[[async-search-intro]]
== Long-running searches
{es} generally allows you to quickly search across big amounts of data. There are
situations where a search executes on many many shards, possibly against
<<frozen-indices,frozen indices>> and spanning multiple
<<modules-remote-clusters,remote clusters>>, for which
results are not expected to be returned in milliseconds. When you need to
execute long-running searches, synchronously
waiting for its results to be returned is not ideal. Instead, Async search lets
you submit a search request that gets executed _asynchronously_,
monitor the progress of the request, and retrieve results at a later stage.
You can also retrieve partial results as they become available but
before the search has completed.
You can submit an async search request using the <<submit-async-search,submit
async search>> API. The <<get-async-search,get async search>> API allows you to
monitor the progress of an async search request and retrieve its results. An
ongoing async search can be deleted through the <<delete-async-search,delete
async search>> API.

View File

@ -30,6 +30,8 @@ include::query-dsl.asciidoc[]
include::modules/cross-cluster-search.asciidoc[]
include::async-search.asciidoc[]
include::scripting.asciidoc[]
include::mapping.asciidoc[]

View File

@ -302,7 +302,7 @@ POST /logs_write/_rollover <2>
}
}
--------------------------------------------------
// TEST[s/now/2016.10.31||/]
// TEST[s/now/2016.10.31%7C%7C/]
<1> Creates an index named with today's date (e.g.) `logs-2016.10.31-1`
<2> Rolls over to a new index with today's date, e.g. `logs-2016.10.31-000002` if run immediately, or `logs-2016.11.01-000002` if run after 24 hours
@ -341,7 +341,7 @@ over indices created in the last three days, you could do the following:
GET /%3Clogs-%7Bnow%2Fd%7D-*%3E%2C%3Clogs-%7Bnow%2Fd-1d%7D-*%3E%2C%3Clogs-%7Bnow%2Fd-2d%7D-*%3E/_search
--------------------------------------------------
// TEST[continued]
// TEST[s/now/2016.10.31||/]
// TEST[s/now/2016.10.31%7C%7C/]
[[rollover-index-api-dry-run-ex]]

View File

@ -25,227 +25,227 @@ index that make warmers not necessary anymore.
See <<commands>>.
[role="exclude",id="xpack-api"]
=== X-Pack APIs
[role="exclude",id="xpack-api"]
=== X-Pack APIs
{es} {xpack} APIs are now documented in <<rest-apis, REST APIs>>.
{es} {xpack} APIs are now documented in <<rest-apis, REST APIs>>.
[role="exclude",id="ml-calendar-resource"]]
=== Calendar resources
[role="exclude",id="ml-calendar-resource"]]
=== Calendar resources
See <<ml-get-calendar>> and
{ml-docs}/ml-calendars.html[Calendars and scheduled events].
See <<ml-get-calendar>> and
{ml-docs}/ml-calendars.html[Calendars and scheduled events].
[role="exclude",id="ml-filter-resource"]
=== Filter resources
[role="exclude",id="ml-filter-resource"]
=== Filter resources
See <<ml-get-filter>> and
{ml-docs}/ml-rules.html[Machine learning custom rules].
See <<ml-get-filter>> and
{ml-docs}/ml-rules.html[Machine learning custom rules].
[role="exclude",id="ml-event-resource"]
=== Scheduled event resources
[role="exclude",id="ml-event-resource"]
=== Scheduled event resources
See <<ml-get-calendar-event>> and
{ml-docs}/ml-calendars.html[Calendars and scheduled events].
See <<ml-get-calendar-event>> and
{ml-docs}/ml-calendars.html[Calendars and scheduled events].
[role="exclude",id="index-apis"]
=== Index APIs
{es} index APIs are now documented in <<indices>>.
[role="exclude",id="index-apis"]
=== Index APIs
{es} index APIs are now documented in <<indices>>.
[role="exclude",id="search-request-docvalue-fields"]
=== Doc value fields parameter for request body search API
See <<request-body-search-docvalue-fields>>.
[role="exclude",id="search-request-docvalue-fields"]
=== Doc value fields parameter for request body search API
See <<request-body-search-docvalue-fields>>.
[role="exclude",id="search-request-explain"]
=== Explain parameter for request body search API
See <<request-body-search-explain>>.
[role="exclude",id="search-request-explain"]
=== Explain parameter for request body search API
See <<request-body-search-explain>>.
[role="exclude",id="search-request-collapse"]
=== Collapse parameter for request body search API
See <<request-body-search-collapse>>.
[role="exclude",id="search-request-collapse"]
=== Collapse parameter for request body search API
See <<request-body-search-collapse>>.
[role="exclude",id="search-request-from-size"]
=== From and size parameters for request body search API
See <<request-body-search-from-size>>.
[role="exclude",id="search-request-from-size"]
=== From and size parameters for request body search API
See <<request-body-search-from-size>>.
[role="exclude",id="search-request-highlighting"]
=== Highlight parameter for request body search API
See <<request-body-search-highlighting>>.
[role="exclude",id="search-request-highlighting"]
=== Highlight parameter for request body search API
See <<request-body-search-highlighting>>.
[role="exclude",id="search-request-index-boost"]
=== Index boost parameter for request body search API
See <<request-body-search-index-boost>>.
[role="exclude",id="search-request-index-boost"]
=== Index boost parameter for request body search API
See <<request-body-search-index-boost>>.
[role="exclude",id="search-request-inner-hits"]
=== Inner hits parameter for request body search API
See <<request-body-search-inner-hits>>.
[role="exclude",id="search-request-inner-hits"]
=== Inner hits parameter for request body search API
See <<request-body-search-inner-hits>>.
[role="exclude",id="search-request-min-score"]
=== Minimum score parameter for request body search API
See <<request-body-search-min-score>>.
[role="exclude",id="search-request-min-score"]
=== Minimum score parameter for request body search API
See <<request-body-search-min-score>>.
[role="exclude",id="search-request-named-queries-and-filters"]
=== Named query parameter for request body search API
See <<request-body-search-queries-and-filters>>.
[role="exclude",id="search-request-named-queries-and-filters"]
=== Named query parameter for request body search API
See <<request-body-search-queries-and-filters>>.
[role="exclude",id="search-request-post-filter"]
=== Post filter parameter for request body search API
See <<request-body-search-post-filter>>.
[role="exclude",id="search-request-post-filter"]
=== Post filter parameter for request body search API
See <<request-body-search-post-filter>>.
[role="exclude",id="search-request-preference"]
=== Preference parameter for request body search API
See <<request-body-search-preference>>.
[role="exclude",id="search-request-preference"]
=== Preference parameter for request body search API
See <<request-body-search-preference>>.
[role="exclude",id="search-request-query"]
=== Query parameter for request body search API
See <<request-body-search-query>>.
[role="exclude",id="search-request-query"]
=== Query parameter for request body search API
See <<request-body-search-query>>.
[role="exclude",id="search-request-rescore"]
=== Rescoring parameter for request body search API
See <<request-body-search-rescore>>.
[role="exclude",id="search-request-rescore"]
=== Rescoring parameter for request body search API
See <<request-body-search-rescore>>.
[role="exclude",id="search-request-script-fields"]
=== Script fields parameter for request body search API
See <<request-body-search-script-fields>>.
[role="exclude",id="search-request-script-fields"]
=== Script fields parameter for request body search API
See <<request-body-search-script-fields>>.
[role="exclude",id="search-request-scroll"]
=== Scroll parameter for request body search API
See <<request-body-search-scroll>>.
[role="exclude",id="search-request-scroll"]
=== Scroll parameter for request body search API
See <<request-body-search-scroll>>.
[role="exclude",id="search-request-search-after"]
=== Search after parameter for request body search API
See <<request-body-search-search-after>>.
[role="exclude",id="search-request-search-after"]
=== Search after parameter for request body search API
See <<request-body-search-search-after>>.
[role="exclude",id="search-request-search-type"]
=== Search type parameter for request body search API
See <<request-body-search-search-type>>.
[role="exclude",id="search-request-search-type"]
=== Search type parameter for request body search API
See <<request-body-search-search-type>>.
[role="exclude",id="search-request-seq-no-primary-term"]
=== Sequence numbers and primary terms parameter for request body search API
See <<request-body-search-search-type>>.
[role="exclude",id="search-request-seq-no-primary-term"]
=== Sequence numbers and primary terms parameter for request body search API
See <<request-body-search-search-type>>.
[role="exclude",id="search-request-sort"]
=== Sort parameter for request body search API
See <<request-body-search-sort>>.
[role="exclude",id="search-request-sort"]
=== Sort parameter for request body search API
See <<request-body-search-sort>>.
[role="exclude",id="search-request-source-filtering"]
=== Source filtering parameter for request body search API
See <<request-body-search-source-filtering>>.
[role="exclude",id="search-request-source-filtering"]
=== Source filtering parameter for request body search API
See <<request-body-search-source-filtering>>.
[role="exclude",id="search-request-stored-fields"]
=== Stored fields parameter for request body search API
See <<request-body-search-stored-fields>>.
[role="exclude",id="search-request-stored-fields"]
=== Stored fields parameter for request body search API
See <<request-body-search-stored-fields>>.
[role="exclude",id="search-request-track-total-hits"]
=== Track total hits parameter for request body search API
See <<request-body-search-track-total-hits>>.
[role="exclude",id="search-request-track-total-hits"]
=== Track total hits parameter for request body search API
See <<request-body-search-track-total-hits>>.
[role="exclude",id="search-request-version"]
=== Version parameter for request body search API
See <<request-body-search-version>>.
[role="exclude",id="search-request-version"]
=== Version parameter for request body search API
See <<request-body-search-version>>.
[role="exclude",id="search-suggesters-term"]
=== Term suggester
See <<term-suggester>>.
[role="exclude",id="search-suggesters-term"]
=== Term suggester
See <<term-suggester>>.
[role="exclude",id="search-suggesters-phrase"]
=== Phrase suggester
See <<phrase-suggester>>.
[role="exclude",id="search-suggesters-phrase"]
=== Phrase suggester
See <<phrase-suggester>>.
[role="exclude",id="search-suggesters-completion"]
=== Completion suggester
See <<completion-suggester>>.
[role="exclude",id="search-suggesters-completion"]
=== Completion suggester
See <<completion-suggester>>.
[role="exclude",id="suggester-context"]
=== Context suggester
See <<context-suggester>>.
[role="exclude",id="suggester-context"]
=== Context suggester
See <<context-suggester>>.
[role="exclude",id="returning-suggesters-type"]
=== Return suggester type
See <<return-suggesters-type>>.
[role="exclude",id="returning-suggesters-type"]
=== Return suggester type
See <<return-suggesters-type>>.
[role="exclude",id="search-profile-queries"]
=== Profiling queries
See <<profiling-queries>>.
[role="exclude",id="search-profile-queries"]
=== Profiling queries
See <<profiling-queries>>.
[role="exclude",id="search-profile-aggregations"]
=== Profiling aggregations
See <<profiling-aggregations>>.
[role="exclude",id="search-profile-aggregations"]
=== Profiling aggregations
See <<profiling-aggregations>>.
[role="exclude",id="search-profile-considerations"]
=== Profiling considerations
See <<profiling-considerations>>.
[role="exclude",id="search-profile-considerations"]
=== Profiling considerations
See <<profiling-considerations>>.
[role="exclude",id="_explain_analyze"]
=== Explain analyze API
See <<explain-analyze-api>>.
[role="exclude",id="_explain_analyze"]
=== Explain analyze API
See <<explain-analyze-api>>.
[role="exclude",id="indices-synced-flush"]
=== Synced flush API
See <<indices-synced-flush-api>>.
[role="exclude",id="indices-synced-flush"]
=== Synced flush API
See <<indices-synced-flush-api>>.
[role="exclude",id="_repositories"]
=== Snapshot repositories
See <<snapshots-repositories>>.
[role="exclude",id="_repositories"]
=== Snapshot repositories
See <<snapshots-repositories>>.
[role="exclude",id="_snapshot"]
=== Snapshot
See <<snapshots-take-snapshot>>.
[role="exclude",id="_snapshot"]
=== Snapshot
See <<snapshots-take-snapshot>>.
[role="exclude",id="getting-started-explore"]
=== Exploring your cluster
See <<cat>>.
[role="exclude",id="getting-started-explore"]
=== Exploring your cluster
See <<cat>>.
[role="exclude",id="getting-started-cluster-health"]
=== Cluster health
See <<cat-health>>.
[role="exclude",id="getting-started-cluster-health"]
=== Cluster health
See <<cat-health>>.
[role="exclude", id="getting-started-list-indices"]
=== List all indices
See <<cat-indices>>.
[role="exclude", id="getting-started-list-indices"]
=== List all indices
See <<cat-indices>>.
[role="exclude", id="getting-started-create-index"]
=== Create an index
See <<indices-create-index>>.
[role="exclude", id="getting-started-create-index"]
=== Create an index
See <<indices-create-index>>.
[role="exclude", id="getting-started-query-document"]
=== Index and query a document
See <<getting-started-index>>.
[role="exclude", id="getting-started-query-document"]
=== Index and query a document
See <<getting-started-index>>.
[role="exclude", id="getting-started-delete-index"]
=== Delete an index
See <<indices-delete-index>>.
[role="exclude", id="getting-started-delete-index"]
=== Delete an index
See <<indices-delete-index>>.
[role="exclude", id="getting-started-modify-data"]
== Modifying your data
See <<docs-update>>.
[role="exclude", id="getting-started-modify-data"]
== Modifying your data
See <<docs-update>>.
[role="exclude", id="indexing-replacing-documents"]
=== Indexing/replacing documents
See <<docs-index_>>.
[role="exclude", id="indexing-replacing-documents"]
=== Indexing/replacing documents
See <<docs-index_>>.
[role="exclude", id="getting-started-explore-data"]
=== Exploring your data
See <<getting-started-search>>.
[role="exclude", id="getting-started-explore-data"]
=== Exploring your data
See <<getting-started-search>>.
[role="exclude", id="getting-started-search-API"]
=== Search API
See <<getting-started-search>>.
[role="exclude", id="getting-started-search-API"]
=== Search API
See <<getting-started-search>>.
[role="exclude", id="getting-started-conclusion"]
=== Conclusion
See <<getting-started-next-steps>>.
[role="exclude", id="getting-started-conclusion"]
=== Conclusion
See <<getting-started-next-steps>>.
[role="exclude",id="ccs-reduction"]
=== {ccs-cap} reduction
See <<ccs-works>>.
[role="exclude",id="ccs-reduction"]
=== {ccs-cap} reduction
See <<ccs-works>>.
[role="exclude",id="administer-elasticsearch"]
=== Administering {es}
See <<high-availability>>.
[role="exclude",id="administer-elasticsearch"]
=== Administering {es}
See <<high-availability>>.
[role="exclude",id="slm-api"]
=== Snapshot lifecycle management API
[role="exclude",id="slm-api"]
=== Snapshot lifecycle management API
See <<snapshot-lifecycle-management-api>>.
[role="exclude",id="delete-data-frame-transform"]
@ -347,7 +347,7 @@ See <<native-realm-configuration>>.
[role="exclude",id="native-settings"]
==== Native realm settings
See <<ref-native-settings>>.
See <<ref-native-settings>>.
[role="exclude",id="configuring-saml-realm"]
=== Configuring a SAML realm
@ -357,27 +357,27 @@ See <<saml-guide>>.
[role="exclude",id="saml-settings"]
==== SAML realm settings
See <<ref-saml-settings>>.
See <<ref-saml-settings>>.
[role="exclude",id="_saml_realm_signing_settings"]
==== SAML realm signing settings
See <<ref-saml-signing-settings>>.
See <<ref-saml-signing-settings>>.
[role="exclude",id="_saml_realm_encryption_settings"]
==== SAML realm encryption settings
See <<ref-saml-encryption-settings>>.
See <<ref-saml-encryption-settings>>.
[role="exclude",id="_saml_realm_ssl_settings"]
==== SAML realm SSL settings
See <<ref-saml-ssl-settings>>.
See <<ref-saml-ssl-settings>>.
[role="exclude",id="configuring-file-realm"]
=== Configuring a file realm
See <<file-realm-configuration>>.
See <<file-realm-configuration>>.
[role="exclude",id="ldap-user-search"]
=== User search mode and user DN templates mode
@ -397,7 +397,7 @@ See <<ref-ldap-settings>>.
[role="exclude",id="ldap-ssl"]
=== Setting up SSL between Elasticsearch and LDAP
See <<tls-ldap>>.
See <<tls-ldap>>.
[role="exclude",id="configuring-kerberos-realm"]
=== Configuring a Kerberos realm
@ -438,7 +438,7 @@ See <<ref-ad-settings>>.
[role="exclude",id="mapping-roles-ad"]
=== Mapping Active Directory users and groups to roles
See <<ad-realm-configuration>>.
See <<ad-realm-configuration>>.
[role="exclude",id="how-security-works"]
=== How security works
@ -471,9 +471,9 @@ See the details in
This page was deleted.
[[ml-datafeed-chunking-config]]
See the details in <<ml-put-datafeed>>, <<ml-update-datafeed>>,
See the details in <<ml-put-datafeed>>, <<ml-update-datafeed>>,
[[ml-datafeed-delayed-data-check-config]]
<<ml-get-datafeed>>,
<<ml-get-datafeed>>,
[[ml-datafeed-counts]]
<<ml-get-datafeed-stats>>.
@ -508,7 +508,7 @@ See <<put-dfanalytics>>.
[role="exclude",id="ml-dfa-analysis-objects"]
=== Analysis configuration objects
This page was deleted.
This page was deleted.
See <<put-dfanalytics>>.
[role="exclude",id="data-frames-settings"]
@ -603,11 +603,6 @@ See <<slm-api-stop>>.
See <<ccs-gateway-seed-nodes>> and <<ccs-min-roundtrips>>.
[role="exclude",id="async-search"]
=== Asynchronous search
coming::[7.x]
[role="exclude",id="data-streams"]
=== Data stream APIs

View File

@ -152,6 +152,8 @@ high). This default value is `5`.
include::search/search.asciidoc[]
include::search/async-search.asciidoc[]
include::search/uri-request.asciidoc[]
include::search/request-body.asciidoc[]

View File

@ -0,0 +1,214 @@
[role="xpack"]
[testenv="basic"]
[[async-search]]
=== Async search
The async search API let you asynchronously execute a
search request, monitor its progress, and retrieve partial results
as they become available.
[[submit-async-search]]
==== Submit async search API
Executes a search request asynchronously. It accepts the same
parameters and request body as the <<search-search,search API>>.
[source,console,id=submit-async-search-date-histogram-example]
--------------------------------------------------
POST /sales*/_async_search?size=0
{
"sort" : [
{ "date" : {"order" : "asc"} }
],
"aggs" : {
"sale_date" : {
"date_histogram" : {
"field" : "date",
"calendar_interval": "1d"
}
}
}
}
--------------------------------------------------
// TEST[setup:sales]
// TEST[s/size=0/size=0&wait_for_completion=0/]
The response contains an identifier of the search being executed.
You can use this ID to later retrieve the search's final results.
The currently available search
results are returned as part of the <<search-api-response-body,`response`>> object.
[source,console-result]
--------------------------------------------------
{
"id" : "FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=", <1>
"version" : 0,
"is_partial" : true, <2>
"is_running" : true, <3>
"start_time_in_millis" : 1583945890986,
"expiration_time_in_millis" : 1584377890986,
"response" : {
"took" : 1122,
"timed_out" : false,
"num_reduce_phases" : 0,
"_shards" : {
"total" : 562, <4>
"successful" : 3, <5>
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 157483, <6>
"relation" : "gte"
},
"max_score" : null,
"hits" : [ ]
}
}
}
--------------------------------------------------
// TESTRESPONSE[s/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=/$body.id/]
// TESTRESPONSE[s/1583945890986/$body.start_time_in_millis/]
// TESTRESPONSE[s/1584377890986/$body.expiration_time_in_millis/]
// TESTRESPONSE[s/"took" : 1122/"took": $body.response.took/]
// TESTRESPONSE[s/"total" : 562/"total": $body.response._shards.total/]
// TESTRESPONSE[s/"successful" : 3/"successful": $body.response._shards.successful/]
// TESTRESPONSE[s/"value" : 157483/"value": $body.response.hits.total.value/]
<1> Identifier of the async search that can be used to monitor its progress, retrieve its results, and/or delete it.
<2> Whether the returned search results are partial or final
<3> Whether the search is still being executed or it has completed
<4> How many shards the search will be executed on, overall
<5> How many shards have successfully completed the search
<6> How many documents are currently matching the query, which belong to the shards that have already completed the search
It is possible to block and wait until the search is completed up to a certain
timeout by providing the `wait_for_completion` parameter, which defaults to
`1` second.
You can also specify how long the async search needs to be
available through the `keep_alive` parameter, which defaults to `5d` (five days).
Ongoing async searches and any saved search results are deleted after this
period.
NOTE: When results are sorted by a numeric field, shards get sorted based on
minimum and maximum value that they hold for that field, hence partial
results become available following the sort criteria that was requested.
The submit async search API supports the same <<search-search-api-query-params,parameters>>
as the search API, though some have different default values:
* `batched_reduce_size` defaults to `5`: this affects how often partial results
become available, which happens whenever shard results are reduced. A partial
reduction is performed every time the coordinating node has received a certain
number of new shard responses (`5` by default).
* `request_cache` defaults to `true`
* `pre_filter_shard_size` defaults to `1`: this is to enforce the execution of
a pre-filter roundtrip to retrieve statistics from each shard so that the ones
that surely don't hold any document matching the query get skipped.
* `ccs_minimize_roundtrips` defaults to `false`, which is also the only
supported value
WARNING: Async search does not support <<request-body-search-scroll,scroll>>
nor search requests that only include the <<search-suggesters,suggest section>>.
{ccs} is supported only with <<ccs-min-roundtrips,`ccs_minimize_roundtrips`>>
set to `false`.
[[get-async-search]]
==== Get async search
The get async search API retrieves the results of a previously submitted
async search request given its id. If the {es} {security-features} are enabled.
the access to the results of a specific async search is restricted to the user
that submitted it in the first place.
[source,console,id=get-async-search-date-histogram-example]
--------------------------------------------------
GET /_async_search/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=
--------------------------------------------------
// TEST[continued s/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=/\${body.id}/]
[source,console-result]
--------------------------------------------------
{
"id" : "FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=",
"version" : 2, <1>
"is_partial" : true, <2>
"is_running" : true, <3>
"start_time_in_millis" : 1583945890986,
"expiration_time_in_millis" : 1584377890986, <4>
"response" : {
"took" : 12144,
"timed_out" : false,
"num_reduce_phases" : 38,
"_shards" : {
"total" : 562,
"successful" : 188,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 456433,
"relation" : "eq"
},
"max_score" : null,
"hits" : [ ]
},
"aggregations" : { <5>
"sale_date" : {
"buckets" : []
}
}
}
}
--------------------------------------------------
// TESTRESPONSE[s/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=/$body.id/]
// TESTRESPONSE[s/"is_partial" : true/"is_partial" : false/]
// TESTRESPONSE[s/"is_running" : true/"is_running" : false/]
// TESTRESPONSE[s/1583945890986/$body.start_time_in_millis/]
// TESTRESPONSE[s/1584377890986/$body.expiration_time_in_millis/]
// TESTRESPONSE[s/"took" : 12144/"took": $body.response.took/]
// TESTRESPONSE[s/"total" : 562/"total": $body.response._shards.total/]
// TESTRESPONSE[s/"successful" : 188/"successful": $body.response._shards.successful/]
// TESTRESPONSE[s/"value" : 456433/"value": $body.response.hits.total.value/]
// TESTRESPONSE[s/"buckets" : \[\]/"buckets": $body.response.aggregations.sale_date.buckets/]
// TESTRESPONSE[s/"num_reduce_phases" : 38,//]
<1> The returned `version` is useful to identify whether the response contains
additional results compared to previously obtained responses. If the version
stays the same, no new results have become available, otherwise a higher version
number indicates that more shards have completed their execution of the query
and their partial results are also included in the response.
<2> Whether the returned search results are partial or final
<3> Whether the search is still being executed or it has completed
<4> When the async search will expire
<5> Partial aggregations results, coming from the shards that have already
completed the execution of the query.
The `wait_for_completion` parameter, which defaults to `1`, can also be provided
when calling the Get Async Search API, in order to wait for the search to be
completed up until the provided timeout. Final results will be returned if
available before the timeout expires, otherwise the currently available results
will be returned once the timeout expires.
The `keep_alive` parameter specifies how long the async search should be
available in the cluster. When not specified, the `keep_alive` set with the
corresponding submit async request will be used. Otherwise, it is possible to
override such value and extend the validity of the request. When this period
expires, the search, if still running, is cancelled. If the search is
completed, its saved results are deleted.
[[delete-async-search]]
==== Delete async search
You can use the delete async search API to manually delete an async search
by ID. If the search is still running, the search request will be cancelled.
Otherwise, the saved search results are deleted.
[source,console,id=delete-async-search-date-histogram-example]
--------------------------------------------------
DELETE /_async_search/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=
--------------------------------------------------
// TEST[continued s/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=/\${body.id}/]

509337
t Normal file

File diff suppressed because one or more lines are too long

View File

@ -3,7 +3,7 @@
"documentation":{
"url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html"
},
"stability":"experimental",
"stability":"stable",
"url":{
"paths":[
{

View File

@ -3,7 +3,7 @@
"documentation":{
"url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html"
},
"stability":"experimental",
"stability":"stable",
"url":{
"paths":[
{

View File

@ -3,7 +3,7 @@
"documentation":{
"url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html"
},
"stability":"experimental",
"stability":"stable",
"url":{
"paths":[
{
@ -32,6 +32,10 @@
"description":"Specify the time that the request should block waiting for the final response",
"default": "1s"
},
"clean_on_completion":{
"type":"boolean",
"description":"Control whether the response should not be stored in the cluster if it completed within the provided [wait_for_completion] time (default: true)"
},
"keep_alive": {
"type": "time",
"description": "Update the time interval in which the results (partial or final) for this search will be available"
@ -41,6 +45,10 @@
"description":"The number of shard results that should be reduced at once on the coordinating node. This value should be used as the granularity at which progress results will be made available.",
"default":5
},
"request_cache":{
"type":"boolean",
"description":"Specify if request cache should be used for this request or not, defaults to true"
},
"analyzer":{
"type":"string",
"description":"The analyzer to use for the query string"
@ -204,18 +212,10 @@
"type":"boolean",
"description":"Specify whether to return sequence number and primary term of the last modification of each hit"
},
"request_cache":{
"type":"boolean",
"description":"Specify if request cache should be used for this request or not, defaults to index level setting"
},
"max_concurrent_shard_requests":{
"type":"number",
"description":"The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests",
"default":5
},
"clean_on_completion":{
"type":"boolean",
"description":"Control whether the response should not be stored in the cluster if it completed within the provided [wait_for_completion] time (default: true)"
}
},
"body":{