public function SearchApiDenormalizedEntityDataSourceController::getIndexStatus in Search API Grouping 7.2
Get information on how many items have been indexed for a certain index.
Parameters
SearchApiIndex $index: The index whose index status should be returned.
Return value
array An associative array containing two keys (in this order):
- indexed: The number of items already indexed in their latest version.
- total: The total number of items that have to be indexed for this index.
Overrides SearchApiAbstractDataSourceController::getIndexStatus
File
- includes/
datasource_denormalized_entity.inc, line 49 - Contains the SearchApiDenormalizedEntityDataSourceController class.
Class
- SearchApiDenormalizedEntityDataSourceController
- Data source for all entities known to the Entity API.
Code
public function getIndexStatus(SearchApiIndex $index) {
$this
->checkIndex($index);
$indexed = db_select($this->table, 'i')
->condition($this->indexIdColumn, $index->id)
->condition($this->changedColumn, 0)
->countQuery()
->execute()
->fetchField();
// Don't count permutations marked for deletion.
$total = db_select($this->table, 'i')
->condition($this->indexIdColumn, $index->id)
->condition($this->changedColumn, 0, '>=')
->countQuery()
->execute()
->fetchField();
return array(
'indexed' => $indexed,
'total' => $total,
);
}