Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
I want to add suggestion to my search autocomplete engine in order to get the following result:
Suppose I have this text : "test claim suggestion"
When I type "text suggestio" I want to get this result "text claim suggestion",
Now I get this "text suggestion" .
Can anybody help me out with this?
Thanks!
Comments
Comment #1
drunken monkeyYou'll have to code that yourself, but it's actually now quite easy (or at least you have several different options) with version 1.4:
hook_search_api_autocomplete_suggestions_alter()
to alter the returned suggestions to, e.g., add your own ones, change existing ones or even remove some.SearchApiAutocompleteSuggesterInterface
class).For versions earlier than 1.4, you only have the first option (or a complex route involving replacing the server backend plugin class).
Also, please make yourself familiar with the different fields used in the issue queue here and how to use them properly!