OpenSearch/docs/reference/search
Luca Cavanna 932a7e3112
Backport of async search changes (#53976)
* Get Async Search: omit _clusters section when empty (#53907)

The _clusters section is omitted by the search API whenever no remote clusters are searched. Async search should do the same, but Get Async Search returns a deserialized response, hence a weird `_clusters` section with all values set to `0` gets returned instead. In fact the recreated Clusters object is not the same object as the EMPTY constant, yet it has the same content.

This commit addresses this by changing the comparison in the `toXContent` method to not print out the section if the number of total clusters is `0`.

* 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

* Async Search: replicas to auto expand from 0 to 1 (#53964)

This way single node clusters that are green don't go yellow once async search is used, while
all the others still have one replica.

* [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 19:13:31 +01:00
..
request Small corrections to stored_fields docs. (#53247) 2020-03-09 10:59:17 -07:00
suggesters [Docs] Fix typo in suggesters search API doc (#48477) 2019-10-29 09:58:05 +01:00
async-search.asciidoc Backport of async search changes (#53976) 2020-03-23 19:13:31 +01:00
count.asciidoc [Docs] Clarify default value for `allow_no_indices` (#52635) (#52697) 2020-02-24 11:57:32 +01:00
explain.asciidoc Upgrade to lucene 8.4.0-snapshot-662c455. (#50016) (#50039) 2019-12-10 18:04:58 +01:00
field-caps.asciidoc [Docs] Clarify default value for `allow_no_indices` (#52635) (#52697) 2020-02-24 11:57:32 +01:00
multi-search.asciidoc [DOCS] Correct multi search API docs (#52523) 2020-02-24 07:43:10 -05:00
profile.asciidoc Optimize sort on numeric long and date fields. (#49732) 2019-11-29 15:37:40 -05:00
rank-eval.asciidoc Adds recall@k metric to rank eval API (#52889) 2020-02-27 16:04:24 +01:00
request-body.asciidoc [DOCS] Fix search request body links (#50500) 2019-12-26 14:31:09 -05:00
search-shards.asciidoc [Docs] Clarify default value for `allow_no_indices` (#52635) (#52697) 2020-02-24 11:57:32 +01:00
search-template.asciidoc [Docs] Clarify default value for `allow_no_indices` (#52635) (#52697) 2020-02-24 11:57:32 +01:00
search.asciidoc [DOCS] Correct `hits.total.relation` response parm def (#52847) 2020-03-04 08:23:34 -05:00
suggesters.asciidoc [DOCS] Reformat suggesters page. (#47010) 2019-09-25 14:42:16 +02:00
uri-request.asciidoc Upgrade to lucene 8.4.0-snapshot-662c455. (#50016) (#50039) 2019-12-10 18:04:58 +01:00
validate.asciidoc [Docs] Clarify default value for `allow_no_indices` (#52635) (#52697) 2020-02-24 11:57:32 +01:00