public function IndexInterface::setFields in Search API 8
Sets this index's fields.
Usually, it's a better idea to add/rename/remove fields individually with the above methods. Use this method only if this is for some reason not easily possible (such as when renaming multiple fields at once might cause conflicts).
Parameters
\Drupal\search_api\Item\FieldInterface[] $fields: An array of fields for this index, keyed by field IDs.
Return value
$this
2 methods override IndexInterface::setFields()
- Index::setFields in src/
Entity/ Index.php - Sets this index's fields.
- UnsavedIndexConfiguration::setFields in src/
UnsavedIndexConfiguration.php - Sets this index's fields.
File
- src/
IndexInterface.php, line 473
Class
- IndexInterface
- Defines the interface for index entities.
Namespace
Drupal\search_apiCode
public function setFields(array $fields);