Support for new SearchRequest and MultiSearchRequest parameter introduced in OS 1.1
Is your feature request related to a problem?
From OS 1.0 onwards, a new request query parameter cancel_after_time_interval was introduced both for SearchRequest and MSearchRequest to provide cancellation of backend request upon timer expiry. This was done to avoid the wasted resource usage from the requests which client application is not waiting for anymore.
What solution would you like? The support for this request parameter is already merged in from OS 1.0 however the clients doesn't have support for passing it to the backend. Would be great if this parameter support can be added in all the clients
What alternatives have you considered? N/A
Do you have any additional context? Issue: https://github.com/opensearch-project/OpenSearch/issues/817 PR: https://github.com/opensearch-project/OpenSearch/commit/e44e890d889d876f12be1d561e4b7017297d8013
On NodeJS the following workaround might work:
opensearch.search(searchParams, { querystring: { cancel_after_time_interval: '2s' }});
@sohami Thank you for raising this issue. Looks like this parameter was not added to [rest-api-spec](https://github.com/opensearch-project/OpenSearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/api/search.json) in OpenSearch. Creating an issue in opensearch-api-specification https://github.com/opensearch-project/opensearch-api-specification/issues/164.
Once the specs in opensearch-api-specification are updated, the clients being generated can be updated. For all other clients, this parameter needs to be added manually.
Moving this to opensearch-api-specification to check whether this was added to the specs.
We have stabilized the OpenAPI spec, if someone wants to take this on, please do! We also support writing tests now :)
Implemented in https://github.com/opensearch-project/opensearch-api-specification/pull/353.