**Elasticsearch version** (`bin/elasticsearch --version`): v7+

**Description of the problem including expected versus actual behavior**:

When used with an alias that has a filter, only the foreground set is filtered. The background set ignores the alias filter. This skews the results, especially when the user supplies an additional foreground filter, assuming the background filter will respect the alias filter.

**Steps to reproduce**:

```
PUT sig_terms_bug
{
  "mappings": {
    "properties": {
      "field1": {
        "type": "keyword"
      },
      "field2": {
        "type": "keyword"
      },
      "field3": {
        "type": "keyword"
      }
    }
  }
}

POST sig_terms_bug/_bulk?refresh=true
{ "index" : {} }
{ "field1" : "failed", "field2": "frontend-node", "field3": "foo" }
{ "index" : {} }
{ "field1" : "failed", "field2": "frontend-node", "field3": "bar" }
{ "index" : {} }
{ "field1" : "failed", "field2": "frontend-node", "field3": "bar" }
{ "index" : {} }
{ "field1" : "success", "field2": "frontend-node", "field3": "bar" }
{ "index" : {} }
{ "field1" : "success", "field2": "frontend-node", "field3": "bar" }
{ "index" : {} }
{ "field1" : "failed", "field2": "backend-node", "field3": "foo" }
{ "index" : {} }
{ "field1" : "failed", "field2": "backend-node", "field3": "bar" }
{ "index" : {} }
{ "field1" : "failed", "field2": "backend-node", "field3": "bar" }
{ "index" : {} }
{ "field1" : "success", "field2": "backend-node", "field3": "bar" }
{ "index" : {} }
{ "field1" : "success", "field2": "backend-node", "field3": "bar" }
{ "index" : {} }

POST _aliases
{
  "actions": [
    {
      "add": {
        "index": "sig_terms_bug",
        "alias": "sig_terms_bug_alias",
        "filter": {
          "bool": {
            "filter": [
              {
                "term": {
                  "field2": "frontend-node"
                }
              }
            ]
          }
        }
      }
    }
  ]
}

GET sig_terms_bug_alias/_search?track_total_hits=true&size=0&filter_path=aggregations
{
  "aggs": {
    "sig_term": {
      "significant_terms": {
        "field": "field3"
      }
    }
  }
}
```

This results in:
```
{
  "aggregations" : {
    "sig_term" : {
      "doc_count" : 5,
      "bg_count" : 10,
      "buckets" : [ ]
    }
  }
}
```

It seems to me that the `bg_count` should respect the alias filter.

server/src/test/java/org/elasticsearch/search/aggregations/bucket/terms/SignificantTermsAggregatorTests.java
IndexSearcher searcher = new IndexSearcher(reader);
                
                SignificantTerms terms = searchAndReduce(searcher, new TermQuery(new Term("text", "odd")), sigAgg, textFieldType);
                assertEquals(0, terms.getBuckets().size());
                assertNull(terms.getBucketByKey("even"));
                assertNull(terms.getBucketByKey("common"));
                assertNull(terms.getBucketByKey("odd"));
            }
        }
    }
    /**
     * Uses the significant terms aggregation on a range field
     */
    public void testRangeField() throws IOException {
        RangeType rangeType = RangeType.DOUBLE;
        final String fieldName = "rangeField";
        MappedFieldType fieldType = new RangeFieldMapper.RangeFieldType(fieldName, rangeType);
        IndexWriterConfig indexWriterConfig = newIndexWriterConfig();
        indexWriterConfig.setMaxBufferedDocs(100);
        indexWriterConfig.setRAMBufferSizeMB(100); 
        try (Directory dir = newDirectory(); IndexWriter w = new IndexWriter(dir, indexWriterConfig)) {
            for (RangeFieldMapper.Range range : new RangeFieldMapper.Range[] {
                new RangeFieldMapper.Range(rangeType, 1L, 5L, true, true),
                new RangeFieldMapper.Range(rangeType, -3L, 4L, true, true),
                new RangeFieldMapper.Range(rangeType, 4L, 13L, true, true),
                new RangeFieldMapper.Range(rangeType, 42L, 49L, true, true), }) {
                Document doc = new Document();
                BytesRef encodedRange = rangeType.encodeRanges(Collections.singleton(range));
                doc.add(new BinaryDocValuesField("field", encodedRange));
                w.addDocument(doc);