Add a way to access the algoliaClient

Created on 4 May 2020, over 4 years ago
Updated 12 August 2024, about 2 months ago

Problem/Motivation

There are valid reasons for accessing the algoliaClient, such as changing context values which is where the connectTimeout is managed.

Proposed resolution

1. Add a new event that lets users access the algoliaClient when it's created.
2. Ensure that we always instantiate the algoliaClient in one place, currently it happens in multiple places.

Remaining tasks

Patch / Testing / Feedback.

📌 Task
Status

Needs review

Version

3.0

Component

Code

Created by

🇦🇺Australia benjy

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Pipeline finished with Success
    about 2 months ago
    Total: 158s
    #250192
  • Pipeline finished with Success
    about 2 months ago
    Total: 133s
    #250205
  • Status changed to Needs review about 2 months ago
  • MR !27 contains changes that allow altering the search client configuration. Now we can use hook alter. Here is an example:

    
    use Algolia\AlgoliaSearch\Config\SearchConfig;
    
    /**
     * Implements hook_search_api_algolia_search_client_config_alter().
     */
    function my_module_search_api_algolia_search_client_config_alter(SearchConfig $config) {
      $config->setConnectTimeout(15);
      $config->setDefaultHeaders([
        'Custom-Header' => 'any value',
      ]);
    }
    
    
  • Pipeline finished with Success
    about 2 months ago
    Total: 165s
    #250207
  • 🇮🇳India nikunjkotecha India, Gujarat, Rajkot

    too many changes, little hard to review

    I will try and validate the code changes in my project

Production build 0.71.5 2024