You are here

class ElasticsearchConnectorSearchApiPrefixSearch in Elasticsearch Connector 7.2

Same name and namespace in other branches
  1. 7.5 modules/elasticsearch_connector_search_api/includes/processor_prefix_search.inc \ElasticsearchConnectorSearchApiPrefixSearch
  2. 7 modules/elasticsearch_connector_search_api/includes/processor_prefix_search.inc \ElasticsearchConnectorSearchApiPrefixSearch

@file Contains the ElasticsearchConnectorSearchApiPrefixSearch class.

Hierarchy

Expanded class hierarchy of ElasticsearchConnectorSearchApiPrefixSearch

1 string reference to 'ElasticsearchConnectorSearchApiPrefixSearch'
elasticsearch_connector_search_api_search_api_processor_info in modules/elasticsearch_connector_search_api/elasticsearch_connector_search_api.module
Implements hook_search_api_processor_info().

File

modules/elasticsearch_connector_search_api/includes/processor_prefix_search.inc, line 7
Contains the ElasticsearchConnectorSearchApiPrefixSearch class.

View source
class ElasticsearchConnectorSearchApiPrefixSearch extends SearchApiAbstractProcessor {

  /**
   * {@inheritdoc}
   */
  public function __construct(SearchApiIndex $index, array $options = array()) {
    parent::__construct($index, $options);
  }

  /**
   * {@inheritdoc}
   */
  public function supportsIndex(SearchApiIndex $index) {
    $server = $index
      ->server();
    if (!empty($server) && $server->class == 'search_api_elasticsearch_connector') {
      return TRUE;
    }
    else {
      return FALSE;
    }
  }

  /**
   * {@inheritdoc}
   */
  public function preprocessSearchQuery(SearchApiQuery $query) {
    $query
      ->setOption(SearchApiElasticsearchConnector::PREFIX_SEARCH_FIELDS, $this->options['fields']);
    $query
      ->setOption(SearchApiElasticsearchConnector::PREFIX_SEARCH, TRUE);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ElasticsearchConnectorSearchApiPrefixSearch::preprocessSearchQuery public function Calls processKeys() for the keys and processFilters() for the filters. Overrides SearchApiAbstractProcessor::preprocessSearchQuery
ElasticsearchConnectorSearchApiPrefixSearch::supportsIndex public function Check whether this processor is applicable for a certain index. Overrides SearchApiAbstractProcessor::supportsIndex
ElasticsearchConnectorSearchApiPrefixSearch::__construct public function Constructor, saving its arguments into properties. Overrides SearchApiAbstractProcessor::__construct
SearchApiAbstractProcessor::$index protected property
SearchApiAbstractProcessor::$options protected property
SearchApiAbstractProcessor::configurationForm public function Display a form for configuring this processor. Since forcing users to specify options for disabled processors makes no sense, none of the form elements should have the '#required' attribute set. Overrides SearchApiProcessorInterface::configurationForm 5
SearchApiAbstractProcessor::configurationFormSubmit public function Submit callback for the form returned by configurationForm(). Overrides SearchApiProcessorInterface::configurationFormSubmit
SearchApiAbstractProcessor::configurationFormValidate public function Validation callback for the form returned by configurationForm(). Overrides SearchApiProcessorInterface::configurationFormValidate 4
SearchApiAbstractProcessor::implodeTokens protected function Internal helper function for imploding tokens into a single string.
SearchApiAbstractProcessor::normalizeTokens protected function Internal helper function for normalizing tokens.
SearchApiAbstractProcessor::postprocessSearchResults public function Does nothing. Overrides SearchApiProcessorInterface::postprocessSearchResults 2
SearchApiAbstractProcessor::preprocessIndexItems public function Calls processField() for all appropriate fields. Overrides SearchApiProcessorInterface::preprocessIndexItems
SearchApiAbstractProcessor::process protected function Function that is ultimately called for all text by the standard implementation, and does nothing by default. 5
SearchApiAbstractProcessor::processField protected function Method for preprocessing field data.
SearchApiAbstractProcessor::processFieldValue protected function Called for processing a single text element in a field. The default implementation just calls process(). 2
SearchApiAbstractProcessor::processFilters protected function Method for preprocessing query filters.
SearchApiAbstractProcessor::processFilterValue protected function Called for processing a single filter value. The default implementation just calls process().
SearchApiAbstractProcessor::processKey protected function Called for processing a single search keyword. The default implementation just calls process().
SearchApiAbstractProcessor::processKeys protected function Method for preprocessing search keys.
SearchApiAbstractProcessor::testField protected function Determines whether to process data from the given field.
SearchApiAbstractProcessor::testType protected function Determines whether fields of the given type should normally be processed.