You are here

interface ParseModeInterface in Search API 8

Defines an interface for parse mode plugins.

Hierarchy

Expanded class hierarchy of ParseModeInterface

All classes that implement ParseModeInterface

See also

\Drupal\search_api\Annotation\SearchApiParseMode

\Drupal\search_api\ParseMode\ParseModePluginManager

\Drupal\search_api\ParseMode\ParseModePluginBase

Plugin API

3 files declare their use of ParseModeInterface
Query.php in src/Query/Query.php
QueryInterface.php in src/Query/QueryInterface.php
SearchApiQuery.php in src/Plugin/views/query/SearchApiQuery.php

File

src/ParseMode/ParseModeInterface.php, line 18

Namespace

Drupal\search_api\ParseMode
View source
interface ParseModeInterface extends HideablePluginInterface, PluginInspectionInterface, DerivativeInspectionInterface, ContainerFactoryPluginInterface {

  /**
   * Returns the label of the parse mode.
   *
   * @return string
   *   The administration label.
   */
  public function label();

  /**
   * Returns the description of the parse mode.
   */
  public function getDescription();

  /**
   * Retrieves the default conjunction.
   *
   * @return string
   *   The default conjunction to be used when parsing keywords. Can be either
   *   "AND" or "OR".
   */
  public function getConjunction();

  /**
   * Sets the default conjunction.
   *
   * @param string $conjunction
   *   The default conjunction to be used when parsing keywords. Can be either
   *   "AND" or "OR".
   *
   * @return $this
   */
  public function setConjunction($conjunction);

  /**
   * Parses search keys input by the user.
   *
   * @param string $keys
   *   The keywords to parse.
   *
   * @return array|string|null
   *   The parsed keywords – either a string, or an array specifying a complex
   *   search expression, or NULL if no keywords should be set for this input.
   *   An array will contain a '#conjunction' key specifying the conjunction
   *   type, and search strings or nested expression arrays at numeric keys.
   *   Additionally, a '#negation' key might be present, which means – unless it
   *   maps to a FALSE value – that the search keys contained in that array
   *   should be negated (that is, not be present in returned results). The
   *   negation works on the whole array, not on each contained term
   *   individually – that is, with the "AND" conjunction and negation, only
   *   results that contain all the terms in the array should be excluded; with
   *   the "OR" conjunction and negation, all results containing one or more of
   *   the terms in the array should be excluded.
   */
  public function parseInput($keys);

}

Members

Namesort descending Modifiers Type Description Overrides
ContainerFactoryPluginInterface::create public static function Creates an instance of the plugin. 112
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
ParseModeInterface::getConjunction public function Retrieves the default conjunction. 1
ParseModeInterface::getDescription public function Returns the description of the parse mode. 1
ParseModeInterface::label public function Returns the label of the parse mode. 1
ParseModeInterface::parseInput public function Parses search keys input by the user. 4
ParseModeInterface::setConjunction public function Sets the default conjunction. 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