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

drunken monkey’s picture

Assigned: m.attar » Unassigned
Category: Feature request » Support request
Priority: Major » Normal
Status: Active » Fixed
Issue tags: -Eweev

You'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:

  • You can use 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.
  • You can write your own, alternative suggester plugin (see the SearchApiAutocompleteSuggesterInterface class).
  • Or you can even use a custom script for creating the suggestions, possibly completely circumventing Drupal.

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!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.