# Disjunctive facets through app-search api

**URL:** <https://discuss.elastic.co/t/disjunctive-facets-through-app-search-api/316537>\
**Category:** Elastic Search\
**Tags:** elastic-app-search\
**Created:** [October 13, 2022, 12:09pm UTC](https://discuss.elastic.co/t/disjunctive-facets-through-app-search-api/316537 "2022-10-13T12:09:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tobias\_Monster](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tobias_monster/32/78611_2.png) [@Tobias\_Monster](https://discuss.elastic.co/u/Tobias_Monster)\
**Post date:** [October 13, 2022, 12:09pm UTC](https://discuss.elastic.co/t/disjunctive-facets-through-app-search-api/316537/1 "2022-10-13T12:09:57Z")

</div>

Is there a way to a facet disjunctive when using a facet query:

I have a query like this:

```auto
"filters": {
        "all": [
            {
                "properties.Color": ["Black"]
            }
        ]
    },
    "facets": {
             "properties.Color": [
            {
                "type": "value",
                "name": "color",
                "sort": {
                    "count": "desc"
                },
                "size": 5
            }
        ]
    },

```

I would like the facet-result to return all colors so that I can query several colors and get results that has either color. While still allowing the user to pick more colors

---

<div class="post-metadata">

**Author:** ![Carlos\_D](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carlos_d/32/126245_2.png) [@Carlos\_D](https://discuss.elastic.co/u/Carlos_D)\
**Post date:** [October 13, 2022, 3:38pm UTC](https://discuss.elastic.co/t/disjunctive-facets-through-app-search-api/316537/2 "2022-10-13T15:38:24Z")

</div>

Hi @Tobias_Monster , welcome to the community!

There is not a direct way of doing disjunctive faceting via App Search API.

However, you could use [Search UI](https://www.elastic.co/enterprise-search/search-ui) for achieving this. Search UI provides disjunctive facets that is done client side - it performs two queries, one with the filter applied and other without.

You can check the [source code for it](https://github.com/elastic/app-search-javascript/blob/master/src/client.js#L86) or use Search UI for interacting with App Search.

Hope this helps!

---

<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:** [November 10, 2022, 3:38pm UTC](https://discuss.elastic.co/t/disjunctive-facets-through-app-search-api/316537/3 "2022-11-10T15:38:56Z")

</div>

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