# App search filters style - performance

**URL:** https://discuss.elastic.co/t/app-search-filters-style-performance/318530
**Category:** Elastic Search
**Tags:** elastic-app-search
**Created:** [November 9, 2022, 10:29am UTC](https://discuss.elastic.co/t/app-search-filters-style-performance/318530 "2022-11-09T10:29:05Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Gerardo\_Zenobi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gerardo_zenobi/32/106790_2.png) [@Gerardo\_Zenobi](https://discuss.elastic.co/u/Gerardo_Zenobi)
#### Post date: [November 9, 2022, 10:29am UTC](https://discuss.elastic.co/t/app-search-filters-style-performance/318530/1 "2022-11-09T10:29:05Z")

</div>

Hi there 👋

Following the syntax for [**search filters**](https://www.elastic.co/guide/en/app-search/current/filters.html), I wanted to know if one of the following ways was recommended/had better performance, given the two produced the same results:

option a (nesting the `any` clause within the `all` root clause):

```auto
filters: {
    all: [
        {company: "c1"},
        {
            any: [
                {a: ["a1", ...]},
                {b: ["b2", ...]},
                {c: ["c1", ...]},
                {d: ["d1", ...]},
                {e: ["e1", ...]},
                {f: ["f1", ...]},
                {g: ["g1", ...]},
                {h: ["h1", ...]},
            ]
        }
    ],
}

```

vs

option B (without nesting):

```auto
filters: {
    all: [
        {company: "c1"}       
    ],
    any: [
        {a: ["a1", ...]},
        {b: ["b2", ...]},
        {c: ["c1", ...]},
        {d: ["d1", ...]},
        {e: ["e1", ...]},
        {f: ["f1", ...]},
        {g: ["g1", ...]},
        {h: ["h1", ...]},
    ]
}

```

Thanks in advance.

---

<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: [December 7, 2022, 10:29am UTC](https://discuss.elastic.co/t/app-search-filters-style-performance/318530/2 "2022-12-07T10:29:37Z")

</div>

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