# Boosting query

**URL:** <https://discuss.elastic.co/t/boosting-query/8431>\
**Category:** Elasticsearch\
**Created:** [July 16, 2012, 7:42pm UTC](https://discuss.elastic.co/t/boosting-query/8431 "2012-07-16T19:42:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vinicius\_Carvalho](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vinicius_carvalho/32/770_2.png) [@Vinicius\_Carvalho](https://discuss.elastic.co/u/Vinicius_Carvalho)\
**Post date:** [July 16, 2012, 7:42pm UTC](https://discuss.elastic.co/t/boosting-query/8431/1 "2012-07-16T19:42:53Z")

</div>

ES Version: 0.19.8

I'm building a query using boosting query as  
follows: [https://gist.github.com/3124567](https://gist.github.com/3124567)

But it seems that boosting is not even being take into account. When I add  
explain=true the boosting part not even shows, and regardless if I use a  
terms or a plain term like term {"name" : "Karaoke"} the results are always  
the same as a plain query string using q=Someone like you.

Am I missing something here?

---

<div class="post-metadata">

**Author:** ![Vinicius\_Carvalho](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vinicius_carvalho/32/770_2.png) [@Vinicius\_Carvalho](https://discuss.elastic.co/u/Vinicius_Carvalho)\
**Post date:** [July 16, 2012, 8:49pm UTC](https://discuss.elastic.co/t/boosting-query/8431/2 "2012-07-16T20:49:37Z")

</div>

My bad, oops, should have used "query\_string" instead of "terms" on the  
boosting 🙂

On Monday, July 16, 2012 3:42:53 PM UTC-4, Vinicius Carvalho wrote:

> ES Version: 0.19.8
> 
> I'm building a query using boosting query as follows:  
> [gist:3124567 · GitHub](https://gist.github.com/3124567)
> 
> But it seems that boosting is not even being take into account. When I add  
> explain=true the boosting part not even shows, and regardless if I use a  
> terms or a plain term like term {"name" : "Karaoke"} the results are always  
> the same as a plain query string using q=Someone like you.
> 
> Am I missing something here?

---

<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:** [July 17, 2012, 8:37am UTC](https://discuss.elastic.co/t/boosting-query/8431/3 "2012-07-17T08:37:29Z")

</div>

> I'm building a query using boosting query as  
> follows: [gist:3124567 · GitHub](https://gist.github.com/3124567)
> 
> But it seems that boosting is not even being take into account. When I  
> add explain=true the boosting part not even shows, and regardless if I  
> use a terms or a plain term like term {"name" : "Karaoke"} the results  
> are always the same as a plain query string using q=Someone like you.

I'm guessing that your 'name' field is mapped as { type: "string" },  
which means that it is being analyzed. So while its value may be  
"Karaoke", the term that is stored is "karaoke".

A term query looks for the exact value. So a term query for "Karaoke"  
would not find anything.

Try using a "text" query instead of a "term" query

clint

---

<div class="post-metadata">

**Author:** ![Vinicius\_Carvalho](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vinicius_carvalho/32/770_2.png) [@Vinicius\_Carvalho](https://discuss.elastic.co/u/Vinicius_Carvalho)\
**Post date:** [July 17, 2012, 3:01pm UTC](https://discuss.elastic.co/t/boosting-query/8431/4 "2012-07-17T15:01:52Z")

</div>

Thanks. Using query\_string did the trick 🙂

On Tuesday, July 17, 2012 4:37:29 AM UTC-4, Clinton Gormley wrote:

> > I'm building a query using boosting query as  
> > follows: [gist:3124567 · GitHub](https://gist.github.com/3124567)
> > 
> > But it seems that boosting is not even being take into account. When I  
> > add explain=true the boosting part not even shows, and regardless if I  
> > use a terms or a plain term like term {"name" : "Karaoke"} the results  
> > are always the same as a plain query string using q=Someone like you.
> 
> I'm guessing that your 'name' field is mapped as { type: "string" },  
> which means that it is being analyzed. So while its value may be  
> "Karaoke", the term that is stored is "karaoke".
> 
> A term query looks for the exact value. So a term query for "Karaoke"  
> would not find anything.
> 
> Try using a "text" query instead of a "term" query
> 
> 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, 3:20am UTC](https://discuss.elastic.co/t/boosting-query/8431/5 "2017-07-06T03:20:07Z")

</div>


