Regexp query flags documentation bug?


(Jamil Bou Kheir-2) #1

Hello,

I'm encountering some unexpected behavior when using the regexp query. I
get zero results when I use the syntax given in the documentationhttp://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-regexp-query.html
:

{
"regexp":{
"name.first": "s.*y",
"flags" : "INTERSECTION|COMPLEMENT|EMPTY"
}
}

However, if I change the syntax to the following, results are returned:

{
"regexp":{
"name.first":{
"value" : "s.*y",
"flags" : "INTERSECTION|COMPLEMENT|EMPTY"
}
}
}

I tested this on 0.90.5, 1.0.0, and 1.1.0 with the same results. Can anyone
confirm?

Jamil

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/52ad8946-2663-4533-a392-ff52155e8ec3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Jamil Bou Kheir-2) #2

I should add that this only occurs within a filtered query, e.g.

{
"query": {
"filtered": {
"filter": {
"regexp": {
"name.first": "s.*y",
"flags": "ALL"
}
}
}
}
}

On Monday, March 31, 2014 2:03:58 PM UTC-7, Jamil Bou Kheir wrote:

Hello,

I'm encountering some unexpected behavior when using the regexp query. I
get zero results when I use the syntax given in the documentationhttp://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-regexp-query.html
:

{
"regexp":{
"name.first": "s.*y",
"flags" : "INTERSECTION|COMPLEMENT|EMPTY"
}
}

However, if I change the syntax to the following, results are returned:

{
"regexp":{
"name.first":{
"value" : "s.*y",
"flags" : "INTERSECTION|COMPLEMENT|EMPTY"
}
}
}

I tested this on 0.90.5, 1.0.0, and 1.1.0 with the same results. Can
anyone confirm?

Jamil

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/728f4123-6d10-4e2f-82c7-8992c3d3d1c8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Binh Ly-2) #3

Thanks, that is an error in the docs and submitted a correction already.
Your second syntax is the correct one.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/777af59c-78dd-42c1-877c-7213dc3b6163%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #4