You are here

protected function Database::getSpecialFields in Search API 8

Creates dummy field objects for the "magic" fields present for every index.

Parameters

\Drupal\search_api\IndexInterface $index: The index for which to create the fields. (Needed since field objects always need an index set.)

\Drupal\search_api\Item\ItemInterface|null $item: (optional) If given, an item whose data should be used for the fields' values.

Return value

\Drupal\search_api\Item\FieldInterface[] An array of field objects for all "magic" fields, keyed by field IDs.

Overrides BackendPluginBase::getSpecialFields

2 calls to Database::getSpecialFields()
Database::fieldsUpdated in modules/search_api_db/src/Plugin/search_api/backend/Database.php
Updates the storage tables when the field configuration changes.
Database::indexItem in modules/search_api_db/src/Plugin/search_api/backend/Database.php
Indexes a single item on the specified index.

File

modules/search_api_db/src/Plugin/search_api/backend/Database.php, line 2815

Class

Database
Indexes and searches items using the database.

Namespace

Drupal\search_api_db\Plugin\search_api\backend

Code

protected function getSpecialFields(IndexInterface $index, ItemInterface $item = NULL) {
  $fields = parent::getSpecialFields($index, $item);
  unset($fields['search_api_id']);
  return $fields;
}