Wildcard search result problems

Dear Elastic search Team,

It seems that the wildcard isnt working for the following example:
Data for search: Task, Tasks, Task to do
If I search with Task* it only returns:
Tasks.
The users expect that it returns all the above mentioned Data... (having several bugs on this) :
Search with wildcard "Task"* : Task, Tasks, Task to do
The search field is mapped with the following attributes:
"type": "text"
** "analyzer": "german"**
I use the German analyzer in order to have the stop words, stemming etc...

Thank you for any help.

Would it be possible to post a recreation of your issue (a few sample docs, the mapping and a query)? That will make it a lot easier to help with your issue.

Which wildcard query are you using? wildcard, match_phrase_prefix or query_string with wildcards? They all behave slightly differently.

Thank you for your answer. I am Using query_string.

The mapping of the filed:

"titelDe":{
"type":"text",
"analyzer":"german",
"fields":{
"titelDeKey":{
"type":"keyword"
}
}
},

The field in ES:

"titelDe": "Basis",
"kurztitelDe": null,
"spracheCode": "de",

and

"titelDe": "Basisvorlage",
"kurztitelDe": null,
"spracheCode": "de",

Searching with query_string and the searchfield Basis* ES returns only Basisvorlage the word Basis is not in the results.

The query:

{ "query": {
"nested": {
"path": "fassungen",
"query": {
"query_string": {
"default_field": "fassungen.titelDe",
"query": "Basis*"
}
}}}
}

Update... It seems that the query returns the correct data.... Basis and Basisvorlage.... False bug alarm!!!

Good news! Those are the best kinds of bugs :slight_smile:

:grin: exactly!!! I am just happy that my searches work correctly with ES!! Thank you again!

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