You are here

interface AutocompleteBackendInterface in Search API Autocomplete 8

Describes the method a backend plugin has to add to support autocompletion.

In addition, the backend has to include "search_api_autocomplete" in the return value of its getSupportedFeatures() implementation.

Please note that this interface is purely documentational. You shouldn't, and can't, implement it explicitly (unless your module is depending on this one).

Hierarchy

Expanded class hierarchy of AutocompleteBackendInterface

All classes that implement AutocompleteBackendInterface

1 file declares its use of AutocompleteBackendInterface
Server.php in src/Plugin/search_api_autocomplete/suggester/Server.php

File

src/AutocompleteBackendInterface.php, line 17

Namespace

Drupal\search_api_autocomplete
View source
interface AutocompleteBackendInterface extends BackendInterface {

  /**
   * Retrieves autocompletion suggestions for some user input.
   *
   * @param \Drupal\search_api\Query\QueryInterface $query
   *   A query representing the base search, with all completely entered words
   *   in the user input so far as the search keys.
   * @param \Drupal\search_api_autocomplete\SearchInterface $search
   *   An object containing details about the search the user is on, and
   *   settings for the autocompletion. See the class documentation for details.
   *   Especially $search->getOptions() should be checked for settings, like
   *   whether to try and estimate result counts for returned suggestions.
   * @param string $incomplete_key
   *   The start of another fulltext keyword for the search, which should be
   *   completed. Might be empty, in which case all user input up to now was
   *   considered completed. Then, additional keywords for the search could be
   *   suggested.
   * @param string $user_input
   *   The complete user input for the fulltext search keywords so far.
   *
   * @return \Drupal\search_api_autocomplete\Suggestion\SuggestionInterface[]
   *   An array of autocomplete suggestions.
   */
  public function getAutocompleteSuggestions(QueryInterface $query, SearchInterface $search, $incomplete_key, $user_input);

}

Members

Namesort descending Modifiers Type Description Overrides
AutocompleteBackendInterface::getAutocompleteSuggestions public function Retrieves autocompletion suggestions for some user input.
BackendInterface::getServer public function Retrieves the server entity for this backend. 1
BackendInterface::postInsert public function Reacts to the server's creation. 1
BackendInterface::postUpdate public function Notifies the backend that its configuration was updated. 1
BackendInterface::preDelete public function Notifies the backend that the server is about to be deleted. 1
BackendInterface::preUpdate public function Notifies the backend that its configuration is about to be updated. 1
BackendInterface::setServer public function Sets the server entity for this backend. 1
BackendSpecificInterface::addIndex public function Adds a new index to this server. 2
BackendSpecificInterface::deleteAllIndexItems public function Deletes all the items from the index. 4
BackendSpecificInterface::deleteItems public function Deletes the specified items from the index. 4
BackendSpecificInterface::getBackendDefinedFields public function Provides information on additional fields made available by the backend. 2
BackendSpecificInterface::getDiscouragedProcessors public function Limits the processors displayed in the UI for indexes on this server. 2
BackendSpecificInterface::getSupportedFeatures public function Returns all features that this backend supports. 2
BackendSpecificInterface::indexItems public function Indexes the specified items. 4
BackendSpecificInterface::isAvailable public function Returns a boolean with the availability of the backend. 2
BackendSpecificInterface::removeIndex public function Removes an index from this server. 2
BackendSpecificInterface::search public function Executes a search on this server. 4
BackendSpecificInterface::supportsDataType public function Determines whether the backend supports a given add-on data type. 2
BackendSpecificInterface::updateIndex public function Notifies the server that an index attached to it has been changed. 2
BackendSpecificInterface::viewSettings public function Returns additional, backend-specific information about this server. 2
ConfigurableInterface::defaultConfiguration public function Gets default configuration for this plugin. 11
ConfigurableInterface::getConfiguration public function Gets this plugin's configuration. 12
ConfigurableInterface::setConfiguration public function Sets the configuration for this plugin instance. 12
ConfigurablePluginInterface::getDescription public function Returns the plugin's description. 1
ConfigurablePluginInterface::label public function Returns the label for use on the administration pages. 1
ConfigurablePluginInterface::onDependencyRemoval public function Informs the plugin that some of its dependencies are being removed. 1
ContainerFactoryPluginInterface::create public static function Creates an instance of the plugin. 112
DependentPluginInterface::calculateDependencies public function Calculates dependencies for the configured plugin. 19
DerivativeInspectionInterface::getBaseId public function Gets the base_plugin_id of the plugin instance. 1
DerivativeInspectionInterface::getDerivativeId public function Gets the derivative_id of the plugin instance. 1
HideablePluginInterface::isHidden public function Determines whether this plugin should be hidden in the UI. 1
PluginInspectionInterface::getPluginDefinition public function Gets the definition of the plugin implementation. 4
PluginInspectionInterface::getPluginId public function Gets the plugin_id of the plugin instance. 2