0

I have algolia integrated with magento 2 site , suddenly algolia is throwing error on product listing page and search page.

Error is about Server connection time out !

enter image description here

2

Finally I got the solution for this issue!! The issue was due to my server's slow connection with algolia server. Algolia search by default uses 1s connection timeout, which I increased to 10 seconds, solved my issue.

To change timeout to 10s we need to edit below file by overriding it:

\vendor\algolia\algoliasearch-client-php\src\AlgoliaSearch\ClientContext.php

  // connect timeout of 1s by default
    $this->connectTimeout = 10;

    // global timeout of 30s by default
    $this->readTimeout = 30;

    // search timeout of 5s by default
    $this->searchTimeout = 10;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.