# Boosting in a query\_string doesn't work on a "not\_analyzed" field

**URL:** <https://discuss.elastic.co/t/boosting-in-a-query-string-doesnt-work-on-a-not-analyzed-field/8605>\
**Category:** Elasticsearch\
**Created:** [August 2, 2012, 10:22am UTC](https://discuss.elastic.co/t/boosting-in-a-query-string-doesnt-work-on-a-not-analyzed-field/8605 "2012-08-02T10:22:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Uli\_Schimpfle](https://avatars.discourse-cdn.com/v4/letter/u/e5b9ba/32.png) [@Uli\_Schimpfle](https://discuss.elastic.co/u/Uli_Schimpfle)\
**Post date:** [August 2, 2012, 10:22am UTC](https://discuss.elastic.co/t/boosting-in-a-query-string-doesnt-work-on-a-not-analyzed-field/8605/1 "2012-08-02T10:22:03Z")

</div>

Hi,

I have a little query\_string which boosts one field :

"query\_string": {  
"query": "name:(se\*)^20 se\*"  
}

I also have a mapping (snippet)  
"name": {  
"type": "string",  
"index": "not\_analyzed"  
},

With the "not\_analyzed" the \_score field is always the same.  
If I delete the "not\_analyzed" mapping I get meaningful \_score values.

Please have a look at :

> <https://gist.github.com/anonymous/3236078>

Thanks,

Uli

---

<div class="post-metadata">

**Author:** ![Simon\_Bettison](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simon_bettison/32/2520_2.png) [@Simon\_Bettison](https://discuss.elastic.co/u/Simon_Bettison)\
**Post date:** [January 22, 2013, 9:16pm UTC](https://discuss.elastic.co/t/boosting-in-a-query-string-doesnt-work-on-a-not-analyzed-field/8605/2 "2013-01-22T21:16:19Z")

</div>

In related news, rails+tire+Elasticsearch, applying boost and not\_analyzed  
breaks indexing.

On Thursday, August 2, 2012 11:22:03 AM UTC+1, Uli Schimpfle wrote:

> Hi,
> 
> I have a little query\_string which boosts one field :
> 
> "query\_string": {  
> "query": "name:(se\*)^20 se\*"  
> }
> 
> I also have a mapping (snippet)  
> "name": {  
> "type": "string",  
> "index": "not\_analyzed"  
> },
> 
> With the "not\_analyzed" the \_score field is always the same.  
> If I delete the "not\_analyzed" mapping I get meaningful \_score values.
> 
> Please have a look at :  
> [ElasticSearch boost/not\_analyzed problem · GitHub](https://gist.github.com/3236078)
> 
> Thanks,
> 
> Uli

--

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [January 23, 2013, 10:33am UTC](https://discuss.elastic.co/t/boosting-in-a-query-string-doesnt-work-on-a-not-analyzed-field/8605/3 "2013-01-23T10:33:44Z")

</div>

Hi Uri

> With the "not\_analyzed" the \_score field is always the same.  
> If I delete the "not\_analyzed" mapping I get meaningful \_score values.

Actually, you're not getting meaningful values. If you add

"explain": true

to your query, you will see that the not\_analyzed and analyzed queries  
behave in exactly the same way. The only difference is the "query norm"  
which is an attempt to normalize scoring between different queries.

Wildcards can not be assigned a meaningful score.

clint

--

---

<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:** [July 6, 2017, 2:55am UTC](https://discuss.elastic.co/t/boosting-in-a-query-string-doesnt-work-on-a-not-analyzed-field/8605/4 "2017-07-06T02:55:03Z")

</div>


