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/main/java/org/elasticsearch/common/Rounding.java
}
            OffsetRounding other = (OffsetRounding) obj;
            return delegate.equals(other.delegate) && offset == other.offset;
        }
        @Override
        public String toString() {
            return delegate + " offset by " + offset;
        }
    }
    public static Rounding read(StreamInput in) throws IOException {
        byte id = in.readByte();
        return switch (id) {
            case TimeUnitRounding.ID -> new TimeUnitRounding(in);
            case TimeIntervalRounding.ID -> new TimeIntervalRounding(in);
            case OffsetRounding.ID -> new OffsetRounding(in);
            default -> throw new ElasticsearchException("unknown rounding id [" + id + "]");
        };
    }
    /**
     * Implementation of {@link Prepared} using pre-calculated "round down" points.
     */
    private static class ArrayRounding implements Prepared {
        private final long[] values;
        private final int max;
        private final Prepared delegate;
        private ArrayRounding(long[] values, int max, Prepared delegate) {
            this.values = values;
            this.max = max;
            this.delegate = delegate;
        }