opensearch-api-specification icon indicating copy to clipboard operation
opensearch-api-specification copied to clipboard

Support for new SearchRequest and MultiSearchRequest parameter introduced in OS 1.1

Open sohami opened this issue 4 years ago • 4 comments

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

sohami avatar Jan 07 '22 18:01 sohami

On NodeJS the following workaround might work:

opensearch.search(searchParams, { querystring: { cancel_after_time_interval: '2s' }});

epiphone avatar Dec 23 '22 07:12 epiphone

@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.

VachaShah avatar Nov 02 '23 20:11 VachaShah

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.

VachaShah avatar Nov 02 '23 20:11 VachaShah

Moving this to opensearch-api-specification to check whether this was added to the specs.

dblock avatar Apr 26 '24 18:04 dblock

We have stabilized the OpenAPI spec, if someone wants to take this on, please do! We also support writing tests now :)

dblock avatar Jun 04 '24 14:06 dblock

Implemented in https://github.com/opensearch-project/opensearch-api-specification/pull/353.

dblock avatar Jun 21 '24 13:06 dblock