Configuring Timeouts
$config = SearchConfig::create('YourApplicationID', 'YourAdminAPIKey'); $config->setConnectTimeout(integer connectTimeout); $config->setReadTimeout(integer readTimeout); $config->setWriteTimeout(integer writeTimeout); SearchClient::createWithConfig($config);
About this method
You are currently reading the JavaScript API client v4 documentation. Check our migration guide to learn how to upgrade from v3 to v4. You can still access the v3 documentation.
You are currently reading the Ruby API client v2 documentation. Check our migration guide to learn how to upgrade from v1 to v2. You can still access the v1 documentation.
Override the pre-configured timeouts.
Network & DNS resolution can be slow. That is why we have pre-configured timeouts. We do not advise to change them, but it could make sense to change them in some special cases.
Note: Not all parameters are available for every language. See Parameters below.
Examples
1
2
3
4
5
6
$config = SearchConfig::create('YourApplicationID', 'YourAdminAPIKey');
$config->setConnectTimeout(2); // connection timeout in seconds
$config->setReadTimeout(30); // read timeout in seconds
$config->setWriteTimeout(30); // write timeout in seconds
SearchClient::createWithConfig($config);
Parameters
connectTimeout
|
type: integer
default: differs per client, see defaults below
Optional
Timeout for the TCP session to connect. Note: Available in all languages except Swift, C#, and Kotlin. Default values:
|
readTimeout
|
type: integer
default: differs per client, see defaults below
Optional
Timeout for the read on the TCP socket. Default values:
|
writeTimeout
|
type: integer
default: differs per client, see defaults below
Optional
Same as requestTimeout, but applies only to write operations. Note: Available in all languages except Android and Scala. Default values:
|
hostDownDelay
|
type: integer
default: differs per client, see defaults below
Optional
The expected period of time for a down host to get back up again. Impacts the time between API Client retries. Note: Only available for Android, C#, Java, Go, and Scala. Default values:
|
dnsTimeout
|
type: integer
default: differs per client, see defaults below
Optional
Timeout for the dns resolution. Note: Only available for Scala. This timeout exists as Default values:
|
searchReadTimeout
|
type: integer
default: differs per client, see defaults below
Optional
Same as requestTimeout, but applies only to search operations. Note: Only available for Swift. Default values:
|
requestTimeout
|
type: integer
default: differs per client, see defaults below
Optional
HTTP timeout for the request. Note: Only available for Scala. Default values: This timeout allows you to configure a global timeout that supersedes all other timeouts. Since it affects all different timeouts, there is no default value. |
Response
No response