public function SearchApiDenormalizedEntityDataSourceController::removeObsoletePermutationsFromIndex in Search API Grouping 7.2
Removes obsolete permutations from the search index.
Parameters
array $items: The items prepared for indexing. Has to be adjusted.
SearchApiIndex $index: The search index to clear obsolete entries from.
File
- includes/
datasource_denormalized_entity.inc, line 470 - Contains the SearchApiDenormalizedEntityDataSourceController class.
Class
- SearchApiDenormalizedEntityDataSourceController
- Data source for all entities known to the Entity API.
Code
public function removeObsoletePermutationsFromIndex(array &$items, SearchApiIndex $index) {
$obsolete_items = db_select($this->table)
->fields($this->table, array(
$this->itemIdColumn,
))
->condition($this->indexIdColumn, $index->id)
->condition($this->changedColumn, -2)
->execute()
->fetchAll(PDO::FETCH_COLUMN, 0);
if ($obsolete_items) {
$items = array_diff_key($items, array_flip($obsolete_items));
search_api_track_item_delete($this->type, $obsolete_items);
}
}