# Simple\_query\_string with first term having a + or - operator

**URL:** <https://discuss.elastic.co/t/simple-query-string-with-first-term-having-a-or-operator/318992>\
**Category:** Elasticsearch\
**Tags:** eql-elastic-query-language\
**Created:** [November 15, 2022, 6:31pm UTC](https://discuss.elastic.co/t/simple-query-string-with-first-term-having-a-or-operator/318992 "2022-11-15T18:31:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Geoff\_Mueller](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/geoff_mueller/32/113391_2.png) [@Geoff\_Mueller](https://discuss.elastic.co/u/Geoff_Mueller)\
**Post date:** [November 15, 2022, 6:31pm UTC](https://discuss.elastic.co/t/simple-query-string-with-first-term-having-a-or-operator/318992/1 "2022-11-15T18:31:39Z")

</div>

Question regarding the use of AND (+) and NOT (-) operators when using the simple\_query\_string query.

It seems there is some inconsistent behavior when performing a query where the first term has an operator included in it.  
For example: query: `+somevalue anothervalue`. when using a `simple_query_string` it seems like the operator is ignored so you get back all results that have either one of these values. If I switched the terms around so the `+somevalue` is after `anothervalue` the results are as desired, i.e. show me all results that include anothervalue AND somevalue

When I use the same query using `query_string` the results are correct regardless of where the and term is.  
Is this a bug or is this how the simple\_query\_string is supposed to interpret the query?

---

<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 13, 2022, 6:31pm UTC](https://discuss.elastic.co/t/simple-query-string-with-first-term-having-a-or-operator/318992/2 "2022-12-13T18:31:50Z")

</div>

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