You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Elasticsearch version (bin/elasticsearch --version):
7.9.3
Plugins installed: []
JVM version (java -version):
JVM: 1.8.0_275
OS version (uname -a if on a Unix-like system):
Linux version 5.4.0-54-generic (buildd@lcy01-amd64-024) (gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)) #60-Ubuntu SMP Fri Nov 6 10:37:59 UTC 2020
Description of the problem including expected versus actual behavior:
When query_string is used for search along with quoted string, the key is not considered properly. Search is initiated across all the keys
Steps to reproduce:
DELETE /test
GET /test
PUT /test
PUT /test/_mapping
{ "properties" : {
"value1" : {
"type" : "text"
},
"value2" : {
"type" : "text"
}
}
}
POST /test/_doc/1
{
"value1":"red small",
"value2":"red2"
}
POST /test/_doc/2
{
"value1":"small",
"value2":"reddd"
}
** Above search returns doc "1", but it should not, Since we are looking for "red small" in value2 key and no document is available in the index like this
Above scenario applicable for below mapping also
DELETE /test
GET /test
PUT /test
PUT /test/_mapping
{ "properties" : {
"value1" : {
"type" : "keyword"
},
"value2" : {
"type" : "keyword"
}
}
}
"Color:=(red OR blue)" => This query_string searches for red or blue in all fields, not only in Color
"Color:=red OR Color:=blue" => This query_string works as expected, searches only in Color field
The text was updated successfully, but these errors were encountered:
Elasticsearch version (
bin/elasticsearch --version
):7.9.3
Plugins installed: []
JVM version (
java -version
):JVM: 1.8.0_275
OS version (
uname -a
if on a Unix-like system):Linux version 5.4.0-54-generic (buildd@lcy01-amd64-024) (gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)) #60-Ubuntu SMP Fri Nov 6 10:37:59 UTC 2020
Description of the problem including expected versus actual behavior:
When query_string is used for search along with quoted string, the key is not considered properly. Search is initiated across all the keys
Steps to reproduce:
DELETE /test
GET /test
PUT /test
PUT /test/_mapping
{ "properties" : {
"value1" : {
"type" : "text"
},
"value2" : {
"type" : "text"
}
}
}
POST /test/_doc/1
{
"value1":"red small",
"value2":"red2"
}
POST /test/_doc/2
{
"value1":"small",
"value2":"reddd"
}
POST /test/_search
{
"query":{
"query_string": {
"query": "value2:="red small""
}
}
}
** Above search returns doc "1", but it should not, Since we are looking for "red small" in value2 key and no document is available in the index like this
Above scenario applicable for below mapping also
DELETE /test
GET /test
PUT /test
PUT /test/_mapping
{ "properties" : {
"value1" : {
"type" : "keyword"
},
"value2" : {
"type" : "keyword"
}
}
}
"Color:=(red OR blue)" => This query_string searches for red or blue in all fields, not only in Color
"Color:=red OR Color:=blue" => This query_string works as expected, searches only in Color field
The text was updated successfully, but these errors were encountered: