You are here

protected function SearchApiElasticsearchQuery::getAggregationLimit in Search API Elasticsearch 7.2

Helper method to get limits for aggregations.

Parameters

$aggregation_info:

Return value

int

1 call to SearchApiElasticsearchQuery::getAggregationLimit()
SearchApiElasticsearchQuery::setAggregationOptions in includes/SearchApiElasticsearchQuery.inc
Configure an aggregation.

File

includes/SearchApiElasticsearchQuery.inc, line 303

Class

SearchApiElasticsearchQuery
@file

Code

protected function getAggregationLimit($aggregation_info) {
  $aggregation_limit = !empty($aggregation_info['limit']) ? $aggregation_info['limit'] : -1;
  if ($aggregation_limit > 0) {
    $aggregation_limit = $this->search_api_query
      ->getOption('facet_limit', 10);
  }
  return $aggregation_limit;
}