# Best practices on detecting QueryString Query

**URL:** <https://discuss.elastic.co/t/best-practices-on-detecting-querystring-query/150779>\
**Category:** Elasticsearch\
**Created:** [October 3, 2018, 12:10am UTC](https://discuss.elastic.co/t/best-practices-on-detecting-querystring-query/150779 "2018-10-03T00:10:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jon\_Hourany](https://avatars.discourse-cdn.com/v4/letter/j/8baadc/32.png) [@Jon\_Hourany](https://discuss.elastic.co/u/Jon_Hourany)\
**Post date:** [October 3, 2018, 12:10am UTC](https://discuss.elastic.co/t/best-practices-on-detecting-querystring-query/150779/1 "2018-10-03T00:10:13Z")

</div>

Currently, given a user query I have a process that passes the query to multiple fields with different analyzers who each add boost the score in some way or another. If the words "AND" or "OR" show up in the query, then it's assumed that those words are part of the document the user is searching for.

I would also like to give users the option of using these boolean connectors if they want to. To me, that means I have run a check on the query string to see if the words "AND", or "OR" or "+/-", etc. are in the string, and if they are, pass the query to a QueryString query instead of the one I've created.

I wanted to ask the community if this is the best way or if there are better ideas than simply check the string for anything that could be a boolean connector.

---

<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:** [October 31, 2018, 12:10am UTC](https://discuss.elastic.co/t/best-practices-on-detecting-querystring-query/150779/2 "2018-10-31T00:10:19Z")

</div>

Closed on October 31, 2018, 12:10am UTC

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