Right now filter aggregations run in "compatible" mode if the top level query is `bool: {filter: { match_all: {}}}}` - but this really just just `match_all` in disguise. We should just run in filter-by-filter mode here.
server/src/test/java/org/elasticsearch/search/aggregations/bucket/filter/FiltersAggregatorTests.java
boolean canUseMetadata,
        IntFunction<List<? extends IndexableField>> buildDocWithField
    ) throws IOException {
        AggregationBuilder builder = new FiltersAggregationBuilder("test", new KeyedFilter("q1", exists));
        
        FieldNamesFieldMapper.FieldNamesFieldType fnft = FieldNamesFieldMapper.FieldNamesFieldType.get(true);
        debugTestCase(builder, new MatchAllDocsQuery(), iw -> {
            for (int i = 0; i < 10; i++) {
                iw.addDocument(buildDocWithField.apply(i));
            }
        }, (InternalFilters result, Class<? extends Aggregator> impl, Map<String, Map<String, Object>> debug) -> {
            assertThat(result.getBuckets(), hasSize(1));
            assertThat(result.getBucketByKey("q1").getDocCount(), equalTo(10L));
            assertThat(impl, equalTo(FilterByFilterAggregator.class));
            MapMatcher expectedFilterDebug = matchesMap().extraOk()
                .entry("specialized_for", "docvalues_field_exists")
                .entry("results_from_metadata", canUseMetadata ? greaterThan(0) : equalTo(0));
            assertMap(debug, matchesMap().entry("test", matchesMap().extraOk().entry("filters", matchesList().item(expectedFilterDebug))));
        }, fieldType, fnft);
    }
    private void docValuesFieldExistsNoDataTestCase(MappedFieldType fieldType) throws IOException {
        QueryBuilder exists = new ExistsQueryBuilder(fieldType.name());
        AggregationBuilder builder = new FiltersAggregationBuilder("test", new KeyedFilter("q1", exists));
        CheckedConsumer<RandomIndexWriter, IOException> buildIndex = iw -> {
            for (int i = 0; i < 10; i++) {
                iw.addDocument(List.of());
            }
        };
        
        FieldNamesFieldMapper.FieldNamesFieldType fnft = FieldNamesFieldMapper.FieldNamesFieldType.get(true);