There is a way to increase the timeout for multi-s...
# community-help
j
There is a way to increase the timeout for multi-search? I increased the timeout value for the python client, but it still times out after 30 seconds, no matter how much I increase the timeout value:
Copy code
Cell In[71], line 48
     34 batch_pages = page_list[i : i + max_searches_per_call]
     36 searches = [
     37     {
     38         'collection':   collection,
   (...)
     45     for page_num in batch_pages
     46 ]
---> 48 resp = typesense_client.multi_search.perform(
     49     {'searches': searches},
     50     {}  # no extra common params
     51 )
     53 # flatten
     54 for result in resp['results']:

File ~/miniconda3/envs/tensorflow_ARM/lib/python3.9/site-packages/typesense/multi_search.py:9, in MultiSearch.perform(self, search_queries, common_params)
      8 def perform(self, search_queries, common_params):
----> 9     return <http://self.api_call.post|self.api_call.post>(MultiSearch.RESOURCE_PATH, search_queries, common_params)

File ~/miniconda3/envs/tensorflow_ARM/lib/python3.9/site-packages/typesense/api_call.py:153, in <http://ApiCall.post|ApiCall.post>(self, endpoint, body, params, as_json)
    151 params = params or {}
    152 ApiCall.normalize_params(params)
--> 153 return self.make_request(<http://session.post|session.post>, endpoint, as_json,
    154                          params=params, data=body,
    155                          timeout=self.config.connection_timeout_seconds)

File ~/miniconda3/envs/tensorflow_ARM/lib/python3.9/site-packages/typesense/api_call.py:116, in ApiCall.make_request(self, fn, endpoint, as_json, **kwargs)
    114             error_message = 'API error.'
    115         # Raised exception will be caught and retried
--> 116         raise ApiCall.get_exception(r.status_code)(r.status_code, error_message)
    118     return r.json() if as_json else r.text
    119 except (requests.exceptions.Timeout, requests.exceptions.ConnectionError, requests.exceptions.HTTPError,
    120         requests.exceptions.RequestException, requests.exceptions.SSLError,
    121         HTTPStatus0Error, ServerError, ServiceUnavailable) as e:
    122     # Catch the exception and retry

TypesenseClientError: [Errno 408] Request Timeout