You are here

interface SearchApiAutocompleteInterface in Search API Autocomplete 7

Interface describing the method a service class has to add to support autocompletion.

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

Hierarchy

Expanded class hierarchy of SearchApiAutocompleteInterface

All classes that implement SearchApiAutocompleteInterface

File

./search_api_autocomplete.interface.php, line 15
Contains SearchApiAutocompleteInterface.

View source
interface SearchApiAutocompleteInterface extends SearchApiServiceInterface {

  /**
  * Retrieves autocompletion suggestions for some user input.
  *
  * For example, when given the user input "teach us", with "us" being
  * considered incomplete, the following might be returned:
  *
  *@code
  *   array(
  *     array(
  *       'prefix' => t('Did you mean:'),
  *       'user_input' => 'reach us',
  *     ),
  *     array(
  *       'user_input' => 'teach us',
  *       'suggestion_suffix' => 'ers',
  *     ),
  *     array(
  *       'user_input' => 'teach us',
  *       'suggestion_suffix' => ' swimming',
  *     ),
  *     'teach users swimming',
  *   );
  * @endcode
  *
  * @param SearchApiQueryInterface $query
  *   A query representing the completed user input so far.
  * @param SearchApiAutocompleteSearch $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->options 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 array
  *   An array of suggestions, as defined by
  *   SearchApiAutocompleteSuggesterInterface::getAutocompleteSuggestions().
  */
  public function getAutocompleteSuggestions(SearchApiQueryInterface $query, SearchApiAutocompleteSearch $search, $incomplete_key, $user_input);

}

Members

Namesort descending Modifiers Type Description Overrides
SearchApiAutocompleteInterface::getAutocompleteSuggestions public function Retrieves autocompletion suggestions for some user input.
SearchApiServiceInterface::addIndex public function Adds a new index to this server. 2
SearchApiServiceInterface::configurationForm public function Form constructor for the server configuration form. 2
SearchApiServiceInterface::configurationFormSubmit public function Submit callback for the form returned by configurationForm(). 2
SearchApiServiceInterface::configurationFormValidate public function Validation callback for the form returned by configurationForm(). 2
SearchApiServiceInterface::deleteItems public function Deletes indexed items from this server. 2
SearchApiServiceInterface::fieldsUpdated public function Notifies the server that the field settings for the index have changed. 2
SearchApiServiceInterface::indexItems public function Indexes the specified items. 2
SearchApiServiceInterface::postCreate public function Reacts to the server's creation. 2
SearchApiServiceInterface::postUpdate public function Notifies this server that its fields are about to be updated. 2
SearchApiServiceInterface::preDelete public function Notifies this server that it is about to be deleted from the database. 2
SearchApiServiceInterface::query public function Creates a query object for searching on an index lying on this server. 2
SearchApiServiceInterface::removeIndex public function Removes an index from this server. 2
SearchApiServiceInterface::search public function Executes a search on the server represented by this object. 3
SearchApiServiceInterface::supportsFeature public function Determines whether this service class supports a given feature. 2
SearchApiServiceInterface::viewSettings public function Displays this server's settings. 2
SearchApiServiceInterface::__construct public function Constructs a service object. 2