You are here

public function DummyFields::addFieldValues in Search API Solr 4.x

Same name and namespace in other branches
  1. 8.3 src/Plugin/search_api/processor/DummyFields.php \Drupal\search_api_solr\Plugin\search_api\processor\DummyFields::addFieldValues()
  2. 8.2 src/Plugin/search_api/processor/DummyFields.php \Drupal\search_api_solr\Plugin\search_api\processor\DummyFields::addFieldValues()

File

src/Plugin/search_api/processor/DummyFields.php, line 49

Class

DummyFields
Adds dummy fields to the indexed data.

Namespace

Drupal\search_api_solr\Plugin\search_api\processor

Code

public function addFieldValues(ItemInterface $item) {
  $fields = $this
    ->getFieldsHelper()
    ->filterForPropertyPath($item
    ->getFields(), $item
    ->getDatasourceId(), 'dummy_field');
  foreach ($fields as $field) {
    $configuration = $field
      ->getConfiguration();
    $field
      ->addValue($configuration['dummy_value']);
  }
}