Retrieve from server autocomplete plugin not working

Created on 16 June 2022, over 2 years ago
Updated 5 April 2024, 9 months ago

Problem/Motivation

Autocomplete does not render any result when "Retrieve from server" suggester selected for a search api view with an elastic index.

After 3 warnings, the following error message appears in the logs:

Error: Call to a member function getSuggesters() on string in Drupal\elasticsearch_connector\Elasticsearch\Parameters\Builder\SearchBuilder->setAutocompleteAggs() (line 801 of web/modules/custom/elasticsearch_connector/src/ElasticSearch/Parameters/Builder/SearchBuilder.php)

Steps to reproduce

1. Install search_api, search_api_autocomplete, elasticsearch_connector 8.0.x-dev
2. Create elasticsearch cluster, search api server and index with for example basic content configuration
3. Create a view with a Fulltext search filter on your elastic index and configure "Display live results" on the autocomplete tab.
4. Create some articles and/or basic pages and index the content
5. Test your view, some autocomplete results will appear.
6. On the autocomplete tab of the search api index disable "Display live results" and enable "Retrieve from server". No autocomplete results will appear.

Proposed resolution

SearchApiElasticsearchBackend::getAutocompleteSuggestions() has not yet been updated to use rufflin/elastica library. Cherrypick code from pySilver's fork for this method.

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

🐛 Bug report
Status

Closed: outdated

Version

8.0

Component

Code

Created by

🇪🇸Spain budalokko Girona

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

Comments & Activities

Not all content is available!

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

Production build 0.71.5 2024