You are here

protected function SearchApiHandlerTrait::getIndex in Search API 8

Returns the active search index.

Return value

\Drupal\search_api\IndexInterface|null The search index to use with this filter, or NULL if none could be loaded.

2 calls to SearchApiHandlerTrait::getIndex()
SearchApiDatasource::getValueOptions in src/Plugin/views/filter/SearchApiDatasource.php
Child classes should be used to override this function and set the 'value options', unless 'options callback' is defined as a valid function or static public method to generate these values.
SearchApiFieldTrait::extractProcessorProperty in src/Plugin/views/field/SearchApiFieldTrait.php
Extracts a processor-based property from an item.

File

src/Plugin/views/SearchApiHandlerTrait.php, line 44

Class

SearchApiHandlerTrait
Provides a trait to use for Search API Views handlers.

Namespace

Drupal\search_api\Plugin\views

Code

protected function getIndex() {
  if ($this
    ->getQuery()) {
    return $this
      ->getQuery()
      ->getIndex();
  }
  $base_table = $this->view->storage
    ->get('base_table');
  return SearchApiQuery::getIndexFromTable($base_table);
}