# Simple\_query\_string flags Does not seem to support "PHRASE" in ES 0.90.10

**URL:** <https://discuss.elastic.co/t/simple-query-string-flags-does-not-seem-to-support-phrase-in-es-0-90-10/15432>\
**Category:** Elasticsearch\
**Created:** [January 27, 2014, 11:08am UTC](https://discuss.elastic.co/t/simple-query-string-flags-does-not-seem-to-support-phrase-in-es-0-90-10/15432 "2014-01-27T11:08:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![loneparadox](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/loneparadox/32/1842_2.png) [@loneparadox](https://discuss.elastic.co/u/loneparadox)\
**Post date:** [January 27, 2014, 11:08am UTC](https://discuss.elastic.co/t/simple-query-string-flags-does-not-seem-to-support-phrase-in-es-0-90-10/15432/1 "2014-01-27T11:08:45Z")

</div>

Hello,

I am using Elastic search "0.90.10", "lucene\_version" : "4.6".

I am trying to use the new "simple\_query\_string" when I add to the flags  
"PHRASE" I get "Unknown simple\_query\_string flag [PHRASE]]"

However If I add the "ALL" flag, it seems to work:

Here is a simple example of what I am doing:  
{  
"query": {  
"filtered": {  
"query": {  
"simple\_query\_string": {  
"query": "horse",  
"fields": [  
"sreferenceNumber^20",  
"sTitle^2",  
"sDescription"  
],  
"flags":"PHRASE",  
"default\_operator":"AND"

```
            }
        }
    }
}

```

}

If I try that same query with the Flags set to all I get results.

Error I am getting, is:  
ElasticSearchIllegalArgumentException[Unknown simple\_query\_string flag  
[PHRASE]];

From  
[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html)  
It seems that it should be possible to send in the "PHRASE" flag.

Maybe you guys can help me in the right direction if I am doing some wrong.

Regards,

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/c507bb36-a6d8-4ac8-9e5b-0c51dedfb14f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c507bb36-a6d8-4ac8-9e5b-0c51dedfb14f%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![loneparadox](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/loneparadox/32/1842_2.png) [@loneparadox](https://discuss.elastic.co/u/loneparadox)\
**Post date:** [January 27, 2014, 2:10pm UTC](https://discuss.elastic.co/t/simple-query-string-flags-does-not-seem-to-support-phrase-in-es-0-90-10/15432/2 "2014-01-27T14:10:24Z")

</div>

There is now an issue for this, please rather see

> <https://github.com/elastic/elasticsearch/issues/4911>
>
> using Elastic search "0.90.10", "lucene\_version" : "4.6"
> 
> Related to https://gro…ups.google.com/d/topic/elasticsearch/TYVqdYQNZVQ/discussion
> 
> I am trying to use the new "simple\_query\_string" when I add to the flags "PHRASE" I get "Unknown simple\_query\_string flag \[PHRASE\]\]"
> 
> However If I add the "ALL" flag, it seems to work.
> 
> Example:
> 
> \`\`\` sh
> curl -XPOST localhost:9200/test/\_search -d '{
> "query": {
> "filtered": {
> "query": {
> "simple\_query\_string": {
> "query": "horse",
> "fields": \[
> "sreferenceNumber^20",
> "sTitle^2",
> "sDescription"
> \],
> "flags":"PHRASE",
> "default\_operator":"AND"
> 
> }
> }
> }
> }
> }'
> \`\`\`
> 
> If I try that same query with the Flags set to all I get results.
> 
> Error I am getting, is:
> 
> \> ElasticSearchIllegalArgumentException\[Unknown simple\_query\_string flag \[PHRASE\]\];
> 
> From http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html
> It seems that it should be possible to send in the "PHRASE" flag.

On Monday, 27 January 2014 13:08:45 UTC+2, loneparadox wrote:

> Hello,
> 
> I am using Elastic search "0.90.10", "lucene\_version" : "4.6".
> 
> I am trying to use the new "simple\_query\_string" when I add to the flags  
> "PHRASE" I get "Unknown simple\_query\_string flag [PHRASE]]"
> 
> However If I add the "ALL" flag, it seems to work:
> 
> Here is a simple example of what I am doing:  
> {  
> "query": {  
> "filtered": {  
> "query": {  
> "simple\_query\_string": {  
> "query": "horse",  
> "fields": [  
> "sreferenceNumber^20",  
> "sTitle^2",  
> "sDescription"  
> ],  
> "flags":"PHRASE",  
> "default\_operator":"AND"
> 
> ```
> }
> }
> }
> }
> 
> ```
> 
> }
> 
> If I try that same query with the Flags set to all I get results.
> 
> Error I am getting, is:  
> ElasticSearchIllegalArgumentException[Unknown simple\_query\_string flag  
> [PHRASE]];
> 
> From  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html)  
> It seems that it should be possible to send in the "PHRASE" flag.
> 
> Maybe you guys can help me in the right direction if I am doing some wrong.
> 
> Regards,

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/21022ea7-7046-4400-a8a1-690155952644%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/21022ea7-7046-4400-a8a1-690155952644%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Binh\_Ly](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@Binh\_Ly](https://discuss.elastic.co/u/Binh_Ly)\
**Post date:** [January 27, 2014, 2:18pm UTC](https://discuss.elastic.co/t/simple-query-string-flags-does-not-seem-to-support-phrase-in-es-0-90-10/15432/3 "2014-01-27T14:18:00Z")

</div>

In the meantime, you can double-quote phrases inside your query while this  
is being fixed. So for example:

"query": ""Horse Racing""

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/b5b6a7a0-0697-4d76-afa7-0ccaf3a867e7%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b5b6a7a0-0697-4d76-afa7-0ccaf3a867e7%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [July 6, 2017, 1:54am UTC](https://discuss.elastic.co/t/simple-query-string-flags-does-not-seem-to-support-phrase-in-es-0-90-10/15432/4 "2017-07-06T01:54:35Z")

</div>


