Hello, all -
I went to convert some code using query_string
to simple_query_string
(using "default_operator": "AND"
for both) and was surprised to find I needed to explicitly say "analyzer": "default"
despite the analyzer
documentation for both being identical. I'm not sure if this is a bug but I found it confusing. Reproducible test case below.
Kind regards,
- Luke
DELETE /myindex
{}
POST /myindex/_doc/1?refresh
{
"title": "Smith & Wesson"
}
# gets expected single result
POST /myindex/_search?pretty
{
"query": {
"query_string": {
"default_operator": "AND",
"query": "Smith & Wesson"
}
}
}
# no result?
POST /myindex/_search?pretty
{
"query": {
"simple_query_string": {
"default_operator": "AND",
"query": "Smith & Wesson"
}
}
}
# gets expected single result when specifying "analyzer": "default"
POST /myindex/_search?pretty
{
"query": {
"simple_query_string": {
"default_operator": "AND",
"query": "Smith & Wesson",
"analyzer": "default"
}
}
}