# Search-ui Issues with Elastic search connector and boolean aggregations

**URL:** <https://discuss.elastic.co/t/search-ui-issues-with-elastic-search-connector-and-boolean-aggregations/312183>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [August 16, 2022, 12:37pm UTC](https://discuss.elastic.co/t/search-ui-issues-with-elastic-search-connector-and-boolean-aggregations/312183 "2022-08-16T12:37:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gorelldk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gorelldk/32/109712_2.png) [@Gorelldk](https://discuss.elastic.co/u/Gorelldk)\
**Post date:** [August 16, 2022, 12:37pm UTC](https://discuss.elastic.co/t/search-ui-issues-with-elastic-search-connector-and-boolean-aggregations/312183/1 "2022-08-16T12:37:26Z")

</div>

We are using Elastic Search-ui to connect to an on premise elastic installation. We are also using Facets, and most is working perfectly. However, when we want to use a boolean facet, out issues starts.  
Elastic provides the boolean aggregation with the values 1 and 0, but the search-UI component expects true and false.  
Can anyone point me in the direction i need to go to fix this?

---

<div class="post-metadata">

**Author:** ![JasonStoltz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonstoltz/32/49893_2.png) [@JasonStoltz](https://discuss.elastic.co/u/JasonStoltz)\
**Post date:** [August 16, 2022, 12:59pm UTC](https://discuss.elastic.co/t/search-ui-issues-with-elastic-search-connector-and-boolean-aggregations/312183/2 "2022-08-16T12:59:13Z")

</div>

Hey @Gorelldk,

I'll enter a bug in the Search UI repository for this. We'll need to update the BooleanFacet component to handle both 1/0 and true/false format. It should be a trivial fix.

In the meantime, you can create a [custom view](https://docs.elastic.co/search-ui/guides/customizing-styles-and-html#customizing-html). You can use the code from the [BooleanFacet](https://github.com/elastic/search-ui/blob/master/packages/react-search-ui-views/src/BooleanFacet.tsx) as your base (just copy/paste it) and customize it to your needs.

> <https://github.com/elastic/search-ui/blob/master/packages/react-search-ui-views/src/BooleanFacet.tsx>

---

<div class="post-metadata">

**Author:** ![Gorelldk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gorelldk/32/109712_2.png) [@Gorelldk](https://discuss.elastic.co/u/Gorelldk)\
**Post date:** [August 16, 2022, 1:07pm UTC](https://discuss.elastic.co/t/search-ui-issues-with-elastic-search-connector-and-boolean-aggregations/312183/3 "2022-08-16T13:07:24Z")

</div>

Hey @JasonStoltz  
Thanks for the quick response! The issue is that elastic still expects true/false as the filter, but returns 0/1 as the possible Keys in the facet options

---

<div class="post-metadata">

**Author:** ![JasonStoltz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonstoltz/32/49893_2.png) [@JasonStoltz](https://discuss.elastic.co/u/JasonStoltz)\
**Post date:** [August 16, 2022, 2:38pm UTC](https://discuss.elastic.co/t/search-ui-issues-with-elastic-search-connector-and-boolean-aggregations/312183/4 "2022-08-16T14:38:35Z")

</div>

I _think_ the answer is still the same.

---

<div class="post-metadata">

**Author:** ![Gorelldk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gorelldk/32/109712_2.png) [@Gorelldk](https://discuss.elastic.co/u/Gorelldk)\
**Post date:** [August 17, 2022, 5:35am UTC](https://discuss.elastic.co/t/search-ui-issues-with-elastic-search-connector-and-boolean-aggregations/312183/5 "2022-08-17T05:35:54Z")

</div>

@JasonStoltz unfortunately the Facet.tsx calls a method called markSelectedFacetValuesFromFilters to determine which facet is selected. This method compares the filters (in this case the filter will have the value "true") and the facet options (which will be 0 and 1) and therefore the facet will never be marked as selected

---

<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:** [September 14, 2022, 5:36am UTC](https://discuss.elastic.co/t/search-ui-issues-with-elastic-search-connector-and-boolean-aggregations/312183/6 "2022-09-14T05:36:24Z")

</div>

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