Wild card queries do not work after normalization

I have next model for elastic:
{
"dev-dzep": {
"aliases": {},
"mappings": {
"usersearchmodel": {
"properties": {
"firstName": {
"type": "string",
"analyzer": "lowerKeyword"
}
}
}
},
"settings": {
"index": {
"creation_date": "1498805992106",
"analysis": {
"analyzer": {
"standard": {
"filter": [
"standard",
"lowercase",
"stop"
],
"char_filter": [
"icu_normalizer"
],
"type": "custom",
"tokenizer": "standard"
},
"lowerKeyword": {
"filter": [
"lowercase",
"icu_normalizer"
],
"char_filter": [
"icu_normalizer"
],
"type": "custom",
"tokenizer": "keyword"
}
}
},
"number_of_shards": "5",
"number_of_replicas": "1",
"uuid": "iglps8zkRa2Q11JHgyAXeg",
"version": {
"created": "2040199"
}
}
},
"warmers": {}
}
}

Next query doesn't work in such case:
POST /dev-dzep/_search
{
"from": 0,
"size": 15,
"track_scores": true,
"sort": [
{
"id": {
"order": "asc"
}
}
],
"query": {
"bool": {
"must": [
{
"bool": {
"should": [
{
"wildcard": {
"firstName": {
"value": "*lizéé"
}
}
}
]
}
}
]
}
}
}

But exact match query gives correct result:

POST /dev-dzep/_search
{
"query": {
"match" : {
"firstName" : "Elizéé"
}
}
}

That's the expected behavior as wildcard queries are not analyzed.

BTW "*xyz" is one of the worse query to run on an elasticsearch cluster. It's like a full scan...

Is there any way to fix this when I need to find word partially. Something that I can use instead of wild card query.
Currently I see only one option - normalize data before elastic build index and use the same normalization for wild card search query.

You can try query string query: Query String Query | Elasticsearch Reference [5.4] | Elastic

But again, let me paste part of the doc: Wildcard Query | Elasticsearch Reference [5.4] | Elastic

Note that this query can be slow, as it needs to iterate over many terms. In order to prevent extremely slow wildcard queries, a wildcard term should not start with one of the wildcards * or ?.

Thanks.
Query string query works.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.