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