# Score defaults to 1.0 when when passed '\*' (wildcard) in the query\_string

**URL:** <https://discuss.elastic.co/t/score-defaults-to-1-0-when-when-passed-wildcard-in-the-query-string/143407>\
**Category:** Elasticsearch\
**Created:** [August 7, 2018, 10:45pm UTC](https://discuss.elastic.co/t/score-defaults-to-1-0-when-when-passed-wildcard-in-the-query-string/143407 "2018-08-07T22:45:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zoheb\_Khan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zoheb_khan/32/92680_2.png) [@Zoheb\_Khan](https://discuss.elastic.co/u/Zoheb_Khan)\
**Post date:** [August 7, 2018, 10:45pm UTC](https://discuss.elastic.co/t/score-defaults-to-1-0-when-when-passed-wildcard-in-the-query-string/143407/1 "2018-08-07T22:45:59Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [August 8, 2018, 1:08am UTC](https://discuss.elastic.co/t/score-defaults-to-1-0-when-when-passed-wildcard-in-the-query-string/143407/2 "2018-08-08T01:08:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Zoheb\_Khan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zoheb_khan/32/92680_2.png) [@Zoheb\_Khan](https://discuss.elastic.co/u/Zoheb_Khan)\
**Post date:** [August 8, 2018, 3:19pm UTC](https://discuss.elastic.co/t/score-defaults-to-1-0-when-when-passed-wildcard-in-the-query-string/143407/3 "2018-08-08T15:19:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [August 9, 2018, 1:56pm UTC](https://discuss.elastic.co/t/score-defaults-to-1-0-when-when-passed-wildcard-in-the-query-string/143407/4 "2018-08-09T13:56:36Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 6, 2018, 1:56pm UTC](https://discuss.elastic.co/t/score-defaults-to-1-0-when-when-passed-wildcard-in-the-query-string/143407/5 "2018-09-06T13:56:37Z")

</div>

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