You are here

public function SearchApiDenormalizedEntityField::preprocessIndexItems in Search API Grouping 7.2

Denormalizes items on behalf of multivalue fields.

Overrides SearchApiAbstractProcessor::preprocessIndexItems

File

includes/processor_denormalize_field.inc, line 120
Processor for configuring the denormalization per index.

Class

SearchApiDenormalizedEntityField
Processor to configure and handle the denormalization per index.

Code

public function preprocessIndexItems(array &$items) {

  // Run default pre-processing first.
  parent::preprocessIndexItems($items);

  // Reduce item data to its denormalized data set.
  foreach ($items as $item_id => $item) {
    $items[$item_id] = $this
      ->createDocument($item, $item_id);
  }

  // Ensure obsolete permutations are removed from index.
  $this->index
    ->datasource()
    ->removeObsoletePermutationsFromIndex($items, $this->index);
}