opensearch-java
opensearch-java copied to clipboard
[DOC] Explain the differences between search timeouts
What do you want to do?
- [ ] Request a change to existing documentation
- [x] Add new documentation
- [ ] Report a technical problem with the documentation
- [ ] Other
Tell us about your request.
I would like to set a timeout on a search request and found two methods in the Java client, searchRequest.setCancelAfterTimeInterval
and SearchSourceBuilder.timeout
. I could find no documentation at all for setCancelAfterTimeInterval
. After reading some issues in the Elasticsearch repository I make the more or less educated gues that the first one is a general timeout while the timeout on the SearchSourceBuilder is set on the shard level. Some documentation to distinguish the two would be very helpful. It would also be good to know if SearchResponse.isTimedOut
refers to both of these timeouts or only one of them.
Submitted an issue in the Java client repo for the team to address.
@snikoyo Thanks, looks like you dug out what these options actually mean - do you want to try to PR an update to the user guide in this repo?
No, I don't actually know, I'm just guessing after reading https://github.com/elastic/elasticsearch/issues/56258 and https://github.com/elastic/elasticsearch/issues/30897