You are here

public function BackendSpecificInterface::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.

2 methods override BackendSpecificInterface::getBackendDefinedFields()
BackendPluginBase::getBackendDefinedFields in src/Backend/BackendPluginBase.php
Provides information on additional fields made available by the backend.
Server::getBackendDefinedFields in src/Entity/Server.php
Provides information on additional fields made available by the backend.

File

src/Backend/BackendSpecificInterface.php, line 110

Class

BackendSpecificInterface
Defines methods common to search servers and backend plugins.

Namespace

Drupal\search_api\Backend

Code

public function getBackendDefinedFields(IndexInterface $index);