opensearch-java icon indicating copy to clipboard operation
opensearch-java copied to clipboard

[DOC] Explain the differences between search timeouts

Open snikoyo opened this issue 1 year ago • 3 comments

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.

snikoyo avatar Jun 02 '23 12:06 snikoyo

Submitted an issue in the Java client repo for the team to address.

hdhalter avatar Jun 14 '23 16:06 hdhalter

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

dblock avatar Jun 20 '23 12:06 dblock

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

snikoyo avatar Jun 26 '23 12:06 snikoyo