Currently, this module only supports retrieving the autocomplete suggestions from the search server, for which the server's backend plugin has to support this. This is a) an unnecessary restriction and b) known to lead to often unhelpful suggestions, since the servers usually don't know which keywords/phrases are actually searched by users – only, which of them will yield results.

Replacing this hard-coded mechanism with a plugin system would make this a lot more flexible and allow other modules to come up with their own ways of computing suggestions.

One possible idea, e.g., would be an integration with the Search API Stats module to suggest the most popular keywords.

Comments

drunken monkey’s picture

Issue summary: View changes
drunken monkey’s picture

Status: Active » Needs review
StatusFileSize
new45.58 KB

Here is a first draft of the patch. Works perfectly fine, though, as far as I can see.
Please test/review!

drunken monkey’s picture

Status: Needs review » Fixed

Committed.

  • drunken monkey committed 6d4c086 on 7.x-1.x
    Issue #2475435 by drunken monkey: Added support for switching the...
drunken monkey’s picture

Status: Fixed » Needs review
StatusFileSize
new1.66 KB

As usual, a few minutes after committing and pushing this, I noticed this breaks handling of the "Submit button selector" configuration field. The attached patch should fix this (and also fix overwriting of the internally stored page ID for Search API Pages searches).

  • drunken monkey committed 894f966 on 7.x-1.x
    Follow-up to #2475435 by drunken monkey: Fixed the autocomplete options...
drunken monkey’s picture

Status: Needs review » Fixed

Committed the follow-up.

Status: Fixed » Closed (fixed)

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