You are here

protected function SearchApiElasticsearchBackend::getFacetLimit in Elasticsearch Connector 8

Same name and namespace in other branches
  1. 8.7 src/Plugin/search_api/backend/SearchApiElasticsearchBackend.php \Drupal\elasticsearch_connector\Plugin\search_api\backend\SearchApiElasticsearchBackend::getFacetLimit()
  2. 8.2 src/Plugin/search_api/backend/SearchApiElasticsearchBackend.php \Drupal\elasticsearch_connector\Plugin\search_api\backend\SearchApiElasticsearchBackend::getFacetLimit()
  3. 8.5 src/Plugin/search_api/backend/SearchApiElasticsearchBackend.php \Drupal\elasticsearch_connector\Plugin\search_api\backend\SearchApiElasticsearchBackend::getFacetLimit()
  4. 8.6 src/Plugin/search_api/backend/SearchApiElasticsearchBackend.php \Drupal\elasticsearch_connector\Plugin\search_api\backend\SearchApiElasticsearchBackend::getFacetLimit()

Helper function that return facet limits.

1 call to SearchApiElasticsearchBackend::getFacetLimit()
SearchApiElasticsearchBackend::addFacetOptions in src/Plugin/search_api/backend/SearchApiElasticsearchBackend.php
Helper function that add options and return facet.

File

src/Plugin/search_api/backend/SearchApiElasticsearchBackend.php, line 1296
Contains the SearchApiElasticsearchBackend object.

Class

SearchApiElasticsearchBackend
Plugin annotation @SearchApiBackend( id = "elasticsearch", label = @Translation("Elasticsearch"), description = @Translation("Index items using an Elasticsearch server.") )

Namespace

Drupal\elasticsearch_connector\Plugin\search_api\backend

Code

protected function getFacetLimit(array $facet_info) {

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