# Alternative to FiltersAggregator.KeyedFilter in new Java Client

**URL:** https://discuss.elastic.co/t/alternative-to-filtersaggregator-keyedfilter-in-new-java-client/323860
**Category:** Elasticsearch
**Tags:** language-clients
**Created:** [January 24, 2023, 4:24pm UTC](https://discuss.elastic.co/t/alternative-to-filtersaggregator-keyedfilter-in-new-java-client/323860 "2023-01-24T16:24:55Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![MrMightyNighty](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mrmightynighty/32/116347_2.png) [@MrMightyNighty](https://discuss.elastic.co/u/MrMightyNighty)
#### Post date: [January 24, 2023, 4:24pm UTC](https://discuss.elastic.co/t/alternative-to-filtersaggregator-keyedfilter-in-new-java-client/323860/1 "2023-01-24T16:24:55Z")

</div>

Hello there,

currently we are in the process of switching to the new Java API Client since Spring Boot 3 isn't supporting the old client anymore (yes you can just add the old client but we want to do it properly 🙂 )

Since there aren't that many migration guides and examples with alternatives to specific queries and aggregations:

Whats the alternative to "FiltersAggregator.KeyedFilter(name, query)"?

We are setting a AggregationsBuilders.filters() with multiple filter (old client):

```auto
AggregationsBuilders.filters("agg_name", 
new FiltersAggregator.KeyedFilter("name", QueryBuilders.boolQuery().must(query)),
...
);

```

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [February 21, 2023, 4:25pm UTC](https://discuss.elastic.co/t/alternative-to-filtersaggregator-keyedfilter-in-new-java-client/323860/2 "2023-02-21T16:25:43Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
