# Scoring when using wildcard search in query\_string

**URL:** <https://discuss.elastic.co/t/scoring-when-using-wildcard-search-in-query-string/241964>\
**Category:** Elasticsearch\
**Created:** [July 21, 2020, 4:29am UTC](https://discuss.elastic.co/t/scoring-when-using-wildcard-search-in-query-string/241964 "2020-07-21T04:29:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vangap](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vangap/32/44927_2.png) [@vangap](https://discuss.elastic.co/u/vangap)\
**Post date:** [July 21, 2020, 4:29am UTC](https://discuss.elastic.co/t/scoring-when-using-wildcard-search-in-query-string/241964/1 "2020-07-21T04:29:30Z")

</div>

Hi,

This may be partly a general FTS question  
If I have two tokens like "abc" and "abc123"

And user searches for "_abc_",

in general is "abc" considered more relevant or "abc123"?  
Is there any deterministic ranking by lucene that one is ranked better than the other always?  
When using in "query\_string" with default rewrite, score is always 1. So, will the returned results always be random when it comes to ranking of the docs with these two terms?

While using query\_string, are there any strategies that I can use to have the exact match "abc" as the top result?

Thanks.

---

<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:** [August 18, 2020, 4:29am UTC](https://discuss.elastic.co/t/scoring-when-using-wildcard-search-in-query-string/241964/2 "2020-08-18T04:29:36Z")

</div>

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