Hi I am wondering why the following query does not hit. Here is the reproducer:
// put index
PUT /test
{
"mappings" : {
"properties" : {
"title": {
"type": "text",
"analyzer": "german"
}
}
}
}
// put test doc
POST /test/_doc
{
"title": "Foober Baren"
}
GET /_analyze
{
"analyzer": "german",
"text": "Foober Baren"
}
// Tokens are "foob" and "bar" as expected
GET /test/_search
{
"query": {
"query_string": {
"default_field": "title",
"analyze_wildcard": true,
"query": "*oober"
}
}
}
If I change the inside query to *oob
it does hit. I would have expected the text on the wildcard also to be analyzed now. If I check how it would be analyzed:
GET /_analyze
{
"analyzer": "german",
"text": "oober"
}
// yields "oob" as token as expexted
so *oober
analyzed should be *oob
and also hit,... did I understand analyze_wildcard
wrong?
Interesting enough the query
GET /test/_search
{
"query": {
"query_string": {
"default_field": "title",
"analyze_wildcard": true,
"query": "foobe*"
}
}
}
does hit which would sugest that foobe*
is analyzed to foob*
and thus hits the foob
token of the document.
It seems that left wildcards only lowercase and then match and right wildcards lowercase and anaylze,... but that would be weird inconsistent behaviour between those? Can anyone confirm or deny/explain this observation?