-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE] Add cancel_after_time_interval to SearchRequest and MsearchRequest #1116
Comments
@Xtansia what are the changes needed in the generator to pick that up? Maybe @dhauverNS can help? |
The size and complexity of the SearchRequest & query types means it's non-trivial to do the initial generation of them. If you wanted to really dig into it that'd be amazing, but I wouldn't categorise it as a "good first issue" per se. So in the meantime it is significantly easier to just add the parameter to the two request classes by hand (copying something like the |
Signed-off-by: uri.nudelman <[email protected]>
* Fixes #1116 Signed-off-by: uri.nudelman <[email protected]> * Adds MsearchRequest. Fixes SearchRequest. Signed-off-by: uri.nudelman <[email protected]> * Update CHANGELOG.md Signed-off-by: uri.nudelman <[email protected]> * spotlessJavaCheck Signed-off-by: uri.nudelman <[email protected]> * Adds Builder Function method in MSearch Signed-off-by: uri.nudelman <[email protected]> --------- Signed-off-by: uri.nudelman <[email protected]> Co-authored-by: uri.nudelman <[email protected]> (cherry picked from commit c84ad24) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
I got the same issue, will this be released in the next version? |
* Fixes #1116 * Adds MsearchRequest. Fixes SearchRequest. * Update CHANGELOG.md * spotlessJavaCheck * Adds Builder Function method in MSearch --------- (cherry picked from commit c84ad24) Signed-off-by: uri.nudelman <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: uri.nudelman <[email protected]>
@chanon-onman A fix was just merged (thanks to @urinud) so should currently be available in |
v2.14.0 has been released and includes the fix for this issue |
Is your feature request related to a problem?
The
cancel_after_time_interval
parameter does not exist for search and msearch requests in the Java client.What solution would you like?
Add
cancel_after_time_interval
toSearchRequest
andMsearchRequest
in the Java client.What alternatives have you considered?
I have not found a workaround.
Do you have any additional context?
Being able to use this parameter is especially useful when using an AWS hosted OpenSearch cluster. Because AWS does not provide a way to set the default
cancel_after_time_interval
setting for a cluster, there doesn't seem to be any other way to ensure that a request which can't be handled in a reasonable time will be cancelled. We have occasionally encountered outages caused by extremely complicated, long-running search requests bogging down the cluster.This parameter was missing from the OpenSearch Open API spec for years, and was finally added in June 2024:
opensearch-project/opensearch-api-specification#273
I see there is work underway to generate the Java client code from the Open API specification, which hopefully will eventually provide a solution. But it would be very useful to be able to set this parameter in the interim.
#366 is the recently merged PR to which I am referring.
The text was updated successfully, but these errors were encountered: