[Search] Add cancelation logic to search example (#118176)

This commit is contained in:
Anton Dosov 2021-11-30 12:35:07 +01:00 committed by GitHub
parent 6d20bf39fd
commit b8a7370156
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 136 additions and 42 deletions

View file

@ -129,6 +129,12 @@ setTimeout(() => {
}, 1000);
```
<DocCallOut color="danger" title="Cancel your searches if results are no longer needed">
Users might no longer be interested in search results. For example, they might start a new search
or leave your app without waiting for the results. You should handle such cases by using
`AbortController` with search API.
</DocCallOut>
#### Search strategies
By default, the search service uses the DSL query and aggregation syntax and returns the response from Elasticsearch as is. It also provides several additional basic strategies, such as Async DSL (`x-pack` default) and EQL.