# Support for user provided boolean expressions/UI

**URL:** <https://discuss.elastic.co/t/support-for-user-provided-boolean-expressions-ui/178333>\
**Category:** Elasticsearch\
**Created:** [April 24, 2019, 9:22pm UTC](https://discuss.elastic.co/t/support-for-user-provided-boolean-expressions-ui/178333 "2019-04-24T21:22:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hacker\_21](https://avatars.discourse-cdn.com/v4/letter/h/a6a055/32.png) [@hacker\_21](https://discuss.elastic.co/u/hacker_21)\
**Post date:** [April 24, 2019, 9:22pm UTC](https://discuss.elastic.co/t/support-for-user-provided-boolean-expressions-ui/178333/1 "2019-04-24T21:22:24Z")

</div>

Hi there,

I'm trying to add support in my application for boolean expressions from the user. I'd like to allow the user to enter multiple keywords such as "Real Estate AND Agent" or a phrase such as "Tech News OR Technology News OR Tech blog OR Tech journalist" or a query like "dental supplies NOT wholesaler".

However, I'll need to receive the input through the search UI, parse for any boolean commands in the string (I'm using Python), and then convert the expression given into a boolean query for ElasticSearch with multiple elements.

Is there a "best practice" for this approach? Or any recommendations? thanks,

---

<div class="post-metadata">

**Author:** ![hacker\_21](https://avatars.discourse-cdn.com/v4/letter/h/a6a055/32.png) [@hacker\_21](https://discuss.elastic.co/u/hacker_21)\
**Post date:** [April 25, 2019, 3:11pm UTC](https://discuss.elastic.co/t/support-for-user-provided-boolean-expressions-ui/178333/2 "2019-04-25T15:11:13Z")

</div>

Any ideas would be greatly appreciated 😃 thanks everyone

---

<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:** [May 23, 2019, 3:11pm UTC](https://discuss.elastic.co/t/support-for-user-provided-boolean-expressions-ui/178333/3 "2019-05-23T15:11:15Z")

</div>

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