This project is not covered by Drupal’s security advisory policy.

This module provides a backend-agnostic way of showing search suggestions as you type into a search field. This works for both autocomplete suggestions (suggesting search terms to complete what you're typing) as well as live results (showing results that match the search terms you've typed).

It has several components that work together to allow a high level of flexibility and customization. It has a snappy AJAX admin UI, and you can define your own plugins and other classes for use in the module easily.

Search Suggesters

Search suggesters provide a unified way of showing almost any type of search suggestion imaginable. They do this by including 3 separate plugin systems that you can mix and match options for. Each suggester you create uses

Form plugin

The Form plugin indicates where your search input is coming from.

Form API

Currently, the only plugin available. It allows you to get the search input from a field within a form displayed anywhere in Drupal.

Searcher plugin

The Searcher plugin takes the input provided by the Form plugin and performs a search using one of several search backends.

Search API

The Search API searcher plugin directly queries a search index and returns the results. This plugin is provided in the search_suggestions_search_api submodule so that the main module does not depend on Search API being installed.

Views

The Views searcher plugin passes the search input into an argument in a View and returns the executed View results.

Display plugin

The Display plugin takes the results provided by the Searcher and formats them for display. The available display plugins depend on the Searcher that is selected. Each display plugin allows you to select a compatible Result Type, which defaults to the normal result type for the Searcher you have selected.

Entity Renderer

This display plugin supports any Searcher that returns entities as its result set, such as Search API and Views. It allows you to render the result entities in any view mode you choose.

Autocomplete

This display plugin supports any Searcher backend which supports autocomplete results. Currently, this is only the Search API searcher, which relies on Search API Autocomplete for its functionality.

This plugin is available in the search_suggestions_autocomplete submodule so that search_api_autocomplete is not required if you don't need that functionality.

Views

This display plugin only works with the Views searcher, and it is used to show the results directly from the View itself however you have them configured.

Suggestion Containers

Each container you create defines a place for adding any number of Search Suggesters to it. There are currently several container plugins available.

Search Input

The Search Input plugin attaches the container to an existing search input field on the site. If you have a search bar already and you want to add search suggestions to it, this is a great option.

Search Input (Modal)

The Search Input (Modal) plugin works the same as the regular Search Input plugin, except it opens up the results in a modal over the page instead of within the page.

Block

The Block plugin defines a new block type that you can place anywhere on your site where the suggestions will display. Each block you create can optionally output its own search input field as well.

Supporting organizations: 

Project information

  • Module categories: Site Search
  • Created by bmcclure on , updated
  • shield alertThis project is not covered by the security advisory policy.
    Use at your own risk! It may have publicly disclosed vulnerabilities.

Releases