Commit Graph

16 Commits

Author SHA1 Message Date
Mayya Sharipova aa76ebbfbe
Set max allowed size for stored async response (#74455)
Add a dynamic transient cluster setting search.max_async_search_response_size
that controls the maximum allowed size for a stored async search
response. The default max size is 10Mb. An attempt to store
an async search response larger than this size will result in error.

Relates to #67594
2021-06-30 10:21:28 -04:00
István Zoltán Szabó fead5bbb97
[DOCS] Fixes typo in async search API docs. (#70448) 2021-03-16 14:36:12 +01:00
Yang Wang 4c090aeeb4
Improve user check for resource sharing and its documentation (#69844)
The user check when accessing shared resources is improved to be more accurate. 
Also add documentation about how it works and its limitations.
2021-03-10 21:55:50 +11:00
Jim Ferenczi f67185f746
Add a cluster privilege to cancel tasks and delete async searches (#68679)
This change adds a new cluster privilege cancel_task that allows to:

Cancel running tasks (_tasks/_cancel).
Cancel and delete async searches.
Today the 'manage' cluster privilege is required to cancel tasks and
to delete async searches when security features are enabled.
This new focused privilege allows to handle tasks and searches only.

The change also adds the privilege to the internal 'kibana_system'
and '_async_search' roles. They both need to be able to cancel tasks
and delete async searches.

Relates #67965
2021-02-16 10:56:17 +01:00
Mayya Sharipova 074f7d2e8a
Async search status (#62947)
Introduce async search status API

GET /_async_search/status/<id>

The API is restricted to the monitoring_user role.

For a running async search, the response is:

```js
{
  "id" : <id>,
  "is_running" : true,
  "is_partial" : true,
  "start_time_in_millis" : 1583945890986,
  "expiration_time_in_millis" : 1584377890986,
  "_shards" : {
      "total" : 562,
      "successful" : 188,
      "skipped" : 0,
      "failed" : 0
  }
}
```

For a completed async search, an additional
`completion_status` fields is added.

```js
{
  "id" : <id>,
  "is_running" : false,
  "is_partial" : false,
  "start_time_in_millis" : 1583945890986,
  "expiration_time_in_millis" : 1584377890986,
  "_shards" : {
      "total" : 562,
      "successful" : 562,
      "skipped" : 0,
      "failed" : 0
  },
 "completion_status" : 200
}
```

Closes #57537
2020-11-03 11:35:28 -05:00
James Rodewig aec26b1a23
[DOCS] Move search pagination content to one page (#60515) 2020-07-31 11:43:06 -04:00
James Rodewig 80b674fb25
[DOCS] Reformat snippets to use two-space indents (#59973) 2020-07-21 12:24:26 -04:00
Luca Cavanna 6a69ab4a3e
[DOCS] Async search: clarify behaviour when submit returns final results (#55934)
* [DOCS] Async search: clarify behaviour when submit returns final results

Closes #55636

* reword

* iter
2020-05-06 10:00:30 +02:00
Luca Cavanna c04bf6e14a
[DOCS] Clarify async search response flags (#55574)
Relates to #55572
2020-04-29 15:21:26 +02:00
Luca Cavanna 1c482141ee
Async search: rename REST parameters (#54198)
This commit renames wait_for_completion to wait_for_completion_timeout in submit async search and get async search.
Also it renames clean_on_completion to keep_on_completion and turns around its behaviour.

Closes #54069
2020-03-26 09:40:05 +01:00
Luca Cavanna 8c29035635
Async search: prevent users from overriding pre_filter_shard_size (#54088)
Submit async search forces pre_filter_shard_size for the underlying search that it creates.
With this commit we also prevent users from overriding such default as part of request validation.
2020-03-24 17:04:38 +01:00
Luca Cavanna aa56f91fba
[DOCS] address timing issue in async search docs tests (#53910)
The docs snippets for submit async search have proven difficult to test as it is not possible to guarantee that you get a response that is not final, even when providing `wait_for_completion=0`. In the docs we want to show though a proper long-running query, and its first response should be partial rather than final.

With this commit we adapt the docs snippets to show a partial response, and replace under the hood all that's needed to make the snippets tests succeed when we get a final response. Also, increased the timeout so we always get a final response.

Closes #53887
Closes #53891
2020-03-23 14:17:53 +01:00
Luca Cavanna 1af04175a1
Async search: remove version from response (#53960)
The goal of the version field was to quickly show when you can expect to find something new in the search response, compared to when nothing has changed. This can also be done by looking at the `_shards` section and `num_reduce_phases` returned with the search response. In fact when there has been one or more additional reduction of the results, you can expect new results in the search response. Otherwise, the `_shards` section could notify of additional failures of shards that have completed the query, but that is not a guarantee that their results will be exposed (only when the following partial reduction is performed their results will be available).

That said this commit clarifies this in the docs and removes the version field from the async search response
2020-03-23 13:42:10 +01:00
Mark Vieira 3cf3f60f93
Mute submit-async-search-date-histogram-example test 2020-03-20 11:19:03 -07:00
Luca Cavanna fc083493d2 [DOCS] correct async search note
The sort optimization kicks in whenever results are sorted by field.
2020-03-20 15:57:43 +01:00
Luca Cavanna 0a93a93069
[DOCS] add docs for async search (#53675)
Relates to #49091

Co-Authored-By: James Rodewig <james.rodewig@elastic.co>
2020-03-20 14:04:33 +01:00