WebDevStudios / wp-search-with-algolia

Improve search on your site. Autocomplete is included, along with full control over look, feel and relevance.
https://wordpress.org/plugins/wp-search-with-algolia/
138 stars 54 forks source link

Allow SearchConfig default parameters to be modified via apply_filters #406

Closed piscis closed 4 months ago

piscis commented 4 months ago

Is your feature request related to a problem? Please describe. We sometimes get errors that the Algolia Host is not reachable. If we do a full re-index of searchable posts (~16000 Posts) I could lead to a Index run failing due to a UnreachableHost exception being thrown.

Describe the solution you'd like I would like to modify the default parameters of SearchConfig specially the connectTimeout, ReadTimeout and writeTimeout. I guess that during load on our backend the default connectTimeout of 2 seconds is not enough for the indexer.

Describe alternatives you've considered I look through the source but was not able to find any filters were I can inject this or modify this.

Additional context none

tw2113 commented 4 months ago

Hi @piscis To be certain, you're referring to details like discussed at https://www.algolia.com/doc/api-reference/api-methods/configuring-timeouts/ ?

Asking because I know last week I pushed up https://github.com/WebDevStudios/wp-search-with-algolia/wiki/Timeouts.

However, if this wiki page doesn't handle things as much as needed, I also had notes for the Algolia Docs page I mention as well, but didn't push anything for that yet because we don't have the filters in place either.

tw2113 commented 4 months ago

Thinking something like https://github.com/WebDevStudios/wp-search-with-algolia/pull/407

piscis commented 4 months ago

Hi @tw2113 exactly I was referrring to the parameters from https://www.algolia.com/doc/api-reference/api-methods/configuring-timeouts/ I'll give it a try with algolia_http_client_options.

I noticed the filter in the plugins codebase but somehow I could not find any documentation and did not know about the plugins wiki page. Thank you for pointing me in the right direction.

tw2113 commented 4 months ago

I was definitely already looking at filtering these arguments anyway, you just prompted me to get started slightly earlier than I was thinking with my PR above. So good timing there.

Leaving this issue open as the ticket for PR #407

tw2113 commented 4 months ago

This has been merged in to the release280 branch.