You are here

protected function SearchApiElasticsearchAbstractService::getAggregationLimit in Search API Elasticsearch 7

Helper function that return facet limits.

1 call to SearchApiElasticsearchAbstractService::getAggregationLimit()
SearchApiElasticsearchElastica::addAggregationOptions in modules/elastica/includes/SearchApiElasticsearchElastica.inc
Helper function that add options and return Aggregation.

File

includes/SearchApiElasticsearchAbstractService.inc, line 607
Provides a Elasticsearch-based service class for the Search API.

Class

SearchApiElasticsearchAbstractService
Elasticsearch service abstract class.

Code

protected function getAggregationLimit(array $aggregation_info) {

  // If no limit (-1) is selected, use the server facet limit option.
  $aggregation_limit = !empty($aggregation_info['limit']) ? $aggregation_info['limit'] : -1;
  if ($aggregation_limit < 0) {
    $aggregation_limit = $this
      ->getOption('facet_limit', 10);
  }
  return $aggregation_limit;
}