# DeprecationWarning for request\_timeout

**URL:** <https://discuss.elastic.co/t/deprecationwarning-for-request-timeout/315311>\
**Category:** Elasticsearch\
**Created:** [September 27, 2022, 8:37pm UTC](https://discuss.elastic.co/t/deprecationwarning-for-request-timeout/315311 "2022-09-27T20:37:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeroen1](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@jeroen1](https://discuss.elastic.co/u/jeroen1)\
**Post date:** [September 27, 2022, 8:37pm UTC](https://discuss.elastic.co/t/deprecationwarning-for-request-timeout/315311/1 "2022-09-27T20:37:45Z")

</div>

I initialize my ES connection in Python with `Elasticsearch.options()`, setting a global timeout. For some complex searches I need a custom (longer) timeout. To achieve this, I use `es.search(request_timeout=timeout, [..])`. With the update to the latest & greatest version, I’ll get a warning for the complex searches:

```auto
DeprecationWarning: Passing transport options in the API method is deprecated. Use 'Elasticsearch.options()' instead.
  result = es.search(request_timeout=timeout, [..])

```

What the cleanest way to implement custom timeouts now, instead of using `request_timeout` for those specific calls? Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 25, 2022, 8:37pm UTC](https://discuss.elastic.co/t/deprecationwarning-for-request-timeout/315311/2 "2022-10-25T20:37:59Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
