You are here

public function BackendPluginBase::getBackendDefinedFields in Search API 8

Provides information on additional fields made available by the backend.

If a backend indexes additional data with items and wants to make this available as fixed fields on the index (for example, to be used with Views), it can implement this method to facilitate this.

Fields returned here are expected to work correctly with this server when used in query conditions, sorts or similar places.

Parameters

\Drupal\search_api\IndexInterface $index: The index for which fields are being determined.

Return value

\Drupal\search_api\Item\FieldInterface[] An array of additional fields that are available for this index, keyed by their field IDs. The field IDs should always start with "search_api_" (avoiding the special field IDs defined by \Drupal\search_api\Query\QueryInterface::sort()) to avoid conflicts with user-defined fields.

Overrides BackendSpecificInterface::getBackendDefinedFields

File

src/Backend/BackendPluginBase.php, line 238

Class

BackendPluginBase
Defines a base class for backend plugins.

Namespace

Drupal\search_api\Backend

Code

public function getBackendDefinedFields(IndexInterface $index) {
  return [];
}