Score defaults to 1.0 when when passed '*' (wildcard) in the query_string

Hi All,

I upgraded the elasticsearch version to 5+ from 1.5 and I see that below query now gives results with default score :
{
"query": {
"bool": {
"filter": {
"bool": {
"should": [{
"type": {
"value": "abc"
}
},
{
"type": {
"value": "xhyz"
}
}],
"must": {
"query_string": {
"analyze_wildcard": true,
"query": "test*"
}
}
}
}
}
}
}

Realized this happens, when I give '*' in front of search query. Please suggest, a different way to achieve the wildcard search, if exist.

Thanks!

You can index with ngrams based analyzer instead and then don't use wildcards at all.

Thanks for your response. Unfortunately, changing the analyzer is not option for me now. Was wondering there still should be a way to resolve the issue by making change to the query.

I thought you asked for "a different way to achieve the wildcard search, if exist.". That's what I answered.

Was wondering there still should be a way to resolve the issue by making change to the query.

What is the issue? Could you share what you got previously, what you have now and why the new response you have is not OK for you?

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