Skip to content
Michael Beckwith edited this page Feb 4, 2025 · 2 revisions

Adjust configuration settings to increase timeout threshold.

Adjust HttpClientInterface arguments

Accurate as of WP Search with Algolia 2.8.x

This documentation a work in progress.

WP Search with Algolia makes use of the HttpClientInterface provided by Algolia's PHP client.

With that, we have the algolia_http_client_options filter available for usage to pass arguments to a new CurlHttpClient instance. Default of an empty array.

With this filter, you can pass an array of valid key/value pairs that are meant to be used with curl_setopt() function calls. The cURL handle will already be managed, this just needs the settings to adjust.

function my_algolia_timeout_increase( $args ) {
	$args['CURLOPT_PROXY'] = WP_PROXY_HOST . ':' . WP_PROXY_PORT;
	return $args;
}
add_filter( 'algolia_http_client_options', 'my_algolia_timeout_increase' );