public function DummyFields::addFieldValues in Search API Solr 8.2
Same name and namespace in other branches
- 8.3 src/Plugin/search_api/processor/DummyFields.php \Drupal\search_api_solr\Plugin\search_api\processor\DummyFields::addFieldValues()
- 4.x src/Plugin/search_api/processor/DummyFields.php \Drupal\search_api_solr\Plugin\search_api\processor\DummyFields::addFieldValues()
Adds the values of properties defined by this processor to the item.
Parameters
\Drupal\search_api\Item\ItemInterface $item: The item whose field values should be added.
Overrides ProcessorPluginBase::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\processorCode
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']);
}
}