SignificantTerms.php 943 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace Elastica\Aggregation;
  3. use Elastica\Query\AbstractQuery;
  4. /**
  5. * Class SignificantTerms.
  6. *
  7. * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-significantterms-aggregation.html
  8. */
  9. class SignificantTerms extends AbstractTermsAggregation
  10. {
  11. /**
  12. * The default source of statistical information for background term frequencies is the entire index and this scope can
  13. * be narrowed through the use of a background_filter to focus in on significant terms within a narrower context.
  14. *
  15. * @param AbstractQuery $filter
  16. *
  17. * @return $this
  18. *
  19. * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-significantterms-aggregation.html#_custom_background_context
  20. */
  21. public function setBackgroundFilter(AbstractQuery $filter)
  22. {
  23. return $this->setParam('background_filter', $filter);
  24. }
  25. }