Loading composer.json +1 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ "extra": { "drush": { "services": { "drush.services.yml": "^9" "drush.services.yml": "^9 || ^10" } } } Loading search_api_algolia.api.php +1 −1 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ use Drupal\search_api\IndexInterface; * @param \Drupal\search_api\Item\ItemInterface[] $items * An array of items to be indexed, keyed by their item IDs. */ function hook_search_api_algolia_objects_alter(array &$objects, \Drupal\search_api\IndexInterface $index, array $items) { function hook_search_api_algolia_objects_alter(array &$objects, IndexInterface $index, array $items) { // Adds a "foo" field with value "bar" to all documents. foreach ($objects as $key => $object) { $objects[$key]['foo'] = 'bar'; Loading search_api_algolia.info.yml +1 −2 Original line number Diff line number Diff line type: module name: 'Algolia Search' description: 'Provides integration with the Algolia search engine' core: 8.x core_version_requirement: ^8 || ^9 core_version_requirement: ^9.3 || ^10 package: Search dependencies: - search_api:search_api search_api_algolia.module +1 −1 Original line number Diff line number Diff line Loading @@ -68,7 +68,7 @@ function search_api_algolia_form_search_api_index_edit_form_alter(&$form, FormSt $form['options']['algolia_index_list'] = [ '#type' => 'item', '#markup' => render($element), '#markup' => \Drupal::service('renderer')->render($element), '#weight' => 3, ]; } Loading src/Plugin/search_api/backend/SearchApiAlgoliaBackend.php +4 −2 Original line number Diff line number Diff line Loading @@ -2,6 +2,8 @@ namespace Drupal\search_api_algolia\Plugin\search_api\backend; use Drupal\search_api_autocomplete\SearchInterface; use Drupal\search_api_autocomplete\Suggestion\SuggestionFactory; use Algolia\AlgoliaSearch\SearchClient; use Algolia\AlgoliaSearch\Exceptions\AlgoliaException; use Algolia\AlgoliaSearch\SearchIndex; Loading Loading @@ -796,14 +798,14 @@ class SearchApiAlgoliaBackend extends BackendPluginBase implements PluginFormInt * * @see \Drupal\search_api_autocomplete\AutocompleteBackendInterface */ public function getAutocompleteSuggestions(QueryInterface $query, \Drupal\search_api_autocomplete\SearchInterface $search, $incomplete_key, $user_input) { public function getAutocompleteSuggestions(QueryInterface $query, SearchInterface $search, $incomplete_key, $user_input) { // This function will be used only is search_api_autocomplete is enabled // and used. We have it here to add the support but it might never be used // in normal cases. $suggestions = []; try { $factory = new \Drupal\search_api_autocomplete\Suggestion\SuggestionFactory($user_input); $factory = new SuggestionFactory($user_input); } catch (\Exception $e) { return $suggestions; Loading Loading
composer.json +1 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ "extra": { "drush": { "services": { "drush.services.yml": "^9" "drush.services.yml": "^9 || ^10" } } } Loading
search_api_algolia.api.php +1 −1 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ use Drupal\search_api\IndexInterface; * @param \Drupal\search_api\Item\ItemInterface[] $items * An array of items to be indexed, keyed by their item IDs. */ function hook_search_api_algolia_objects_alter(array &$objects, \Drupal\search_api\IndexInterface $index, array $items) { function hook_search_api_algolia_objects_alter(array &$objects, IndexInterface $index, array $items) { // Adds a "foo" field with value "bar" to all documents. foreach ($objects as $key => $object) { $objects[$key]['foo'] = 'bar'; Loading
search_api_algolia.info.yml +1 −2 Original line number Diff line number Diff line type: module name: 'Algolia Search' description: 'Provides integration with the Algolia search engine' core: 8.x core_version_requirement: ^8 || ^9 core_version_requirement: ^9.3 || ^10 package: Search dependencies: - search_api:search_api
search_api_algolia.module +1 −1 Original line number Diff line number Diff line Loading @@ -68,7 +68,7 @@ function search_api_algolia_form_search_api_index_edit_form_alter(&$form, FormSt $form['options']['algolia_index_list'] = [ '#type' => 'item', '#markup' => render($element), '#markup' => \Drupal::service('renderer')->render($element), '#weight' => 3, ]; } Loading
src/Plugin/search_api/backend/SearchApiAlgoliaBackend.php +4 −2 Original line number Diff line number Diff line Loading @@ -2,6 +2,8 @@ namespace Drupal\search_api_algolia\Plugin\search_api\backend; use Drupal\search_api_autocomplete\SearchInterface; use Drupal\search_api_autocomplete\Suggestion\SuggestionFactory; use Algolia\AlgoliaSearch\SearchClient; use Algolia\AlgoliaSearch\Exceptions\AlgoliaException; use Algolia\AlgoliaSearch\SearchIndex; Loading Loading @@ -796,14 +798,14 @@ class SearchApiAlgoliaBackend extends BackendPluginBase implements PluginFormInt * * @see \Drupal\search_api_autocomplete\AutocompleteBackendInterface */ public function getAutocompleteSuggestions(QueryInterface $query, \Drupal\search_api_autocomplete\SearchInterface $search, $incomplete_key, $user_input) { public function getAutocompleteSuggestions(QueryInterface $query, SearchInterface $search, $incomplete_key, $user_input) { // This function will be used only is search_api_autocomplete is enabled // and used. We have it here to add the support but it might never be used // in normal cases. $suggestions = []; try { $factory = new \Drupal\search_api_autocomplete\Suggestion\SuggestionFactory($user_input); $factory = new SuggestionFactory($user_input); } catch (\Exception $e) { return $suggestions; Loading