- Status changed to Needs review
3 months ago 9:15pm 10 August 2024 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', ]); }
- 🇮🇳India nikunjkotecha India, Gujarat, Rajkot
too many changes, little hard to review
I will try and validate the code changes in my project
- 🇺🇸United States kknoer
I'm not sure I understand the need for this change in the v3 version of this module. I assume that this issue can be closed?
As mentioned, the underlying Algolia upgrade in https://www.drupal.org/project/search_api_algolia/issues/3091525 → allows for client access.
Also, this patch would require further cleanup as it doesn't appear to follow the module/Drupal's coding style.
@kknoer, these changes provide access to the client and allow alter client's config in custom modules.
Check this issue ✨ Add referer header for Algolia API restriction Closed: works as designed , an example of use here #3133304-6: Add a way to access the algoliaClient → .In the mentioned task, we are updating the used SDK.
The code style is not a problem of the current task. I partially fixed some of the errors in this task, the rest can be fixed in other issues.