You are here

protected function SearchApiAlterAddAggregation::getTypes in Search API 7

Helper method for getting all available aggregation types.

Parameters

string $info: (optional) One of "name", "type" or "description", to indicate what information should be returned for the types.

Return value

string[] An associative array of aggregation type identifiers mapped to their names, data types or descriptions, as requested.

4 calls to SearchApiAlterAddAggregation::getTypes()
SearchApiAlterAddAggregation::alterItems in includes/callback_add_aggregation.inc
Alter items before indexing.
SearchApiAlterAddAggregation::configurationForm in includes/callback_add_aggregation.inc
Implements SearchApiAlterCallbackInterface::configurationForm().
SearchApiAlterAddAggregation::fieldDescription in includes/callback_add_aggregation.inc
Helper method for creating a field description.
SearchApiAlterAddAggregation::propertyInfo in includes/callback_add_aggregation.inc
Implements SearchApiAlterCallbackInterface::propertyInfo().

File

includes/callback_add_aggregation.inc, line 310
Contains SearchApiAlterAddAggregation.

Class

SearchApiAlterAddAggregation
Search API data alteration callback that adds an URL field for all items.

Code

protected function getTypes($info = 'name') {
  switch ($info) {
    case 'name':
      return array(
        'fulltext' => t('Fulltext'),
        'sum' => t('Sum'),
        'count' => t('Count'),
        'max' => t('Maximum'),
        'min' => t('Minimum'),
        'first' => t('First'),
        'first_char' => t('First letter'),
        'last' => t('Last'),
        'list' => t('List'),
      );
    case 'type':
      return array(
        'fulltext' => 'text',
        'sum' => 'integer',
        'count' => 'integer',
        'max' => 'integer',
        'min' => 'integer',
        'first' => 'token',
        'first_char' => 'token',
        'last' => 'token',
        'list' => 'list<token>',
      );
    case 'description':
      return array(
        'fulltext' => t('The Fulltext aggregation concatenates the text data of all contained fields.'),
        'sum' => t('The Sum aggregation adds the values of all contained fields numerically.'),
        'count' => t('The Count aggregation takes the total number of contained field values as the aggregated field value.'),
        'max' => t('The Maximum aggregation computes the numerically largest contained field value.'),
        'min' => t('The Minimum aggregation computes the numerically smallest contained field value.'),
        'first' => t('The First aggregation will simply keep the first encountered field value. This is helpful foremost when you know that a list field will only have a single value.'),
        'first_char' => t('The "First letter" aggregation uses just the first letter of the first encountered field value as the aggregated value. This can, for example, be used to build a Glossary view.'),
        'last' => t('The Last aggregation will simply keep the last encountered field value.'),
        'list' => t('The List aggregation collects all field values into a multi-valued field containing all values.'),
      );
  }
  return array();
}