Hello All -
I've come upon a behavior which I don't like. If the fields
searched by query_string
include a keyword
(unanalyzed
) field in addition to an analyzed
field, it seems the token-level analyzer won't omit symbols. Below is a Kibana Dev Tools Console example I tested with Elasticsearch 5.6.12 . We're in the midst of migrating to Elasticsearch 6 and I introduced this buggy behavior to our app when i disabled _all
and turned on "all_fields": true
by default (as part of our gradual migration). Is there a workaround for this that doesn't involve explicitly specifying only analyzed fields? I tried adding "analyzer": "standard"
without success.
Thanks in advance,
- Luke
PUT example
{}
PUT /example/widget/1
{
"name": "alpha beta"
}
# hits
GET /example/_search
{
"query": {
"query_string": {
"default_operator": "AND",
"query": "alpha & beta",
"fields": ["name"]
}
}
}
# no hits!?
GET /example/_search
{
"query": {
"query_string": {
"default_operator": "AND",
"query": "alpha & beta",
"fields": ["name", "name.keyword"]
}
}
}