# Understanding how to use the indexed \_boost field

**URL:** <https://discuss.elastic.co/t/understanding-how-to-use-the-indexed--boost-field/4591>\
**Category:** Elasticsearch\
**Created:** [June 9, 2011, 8:34pm UTC](https://discuss.elastic.co/t/understanding-how-to-use-the-indexed--boost-field/4591 "2011-06-09T20:34:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karussell1](https://avatars.discourse-cdn.com/v4/letter/k/50afbb/32.png) [@Karussell1](https://discuss.elastic.co/u/Karussell1)\
**Post date:** [June 9, 2011, 8:34pm UTC](https://discuss.elastic.co/t/understanding-how-to-use-the-indexed--boost-field/4591/1 "2011-06-09T20:34:08Z")

</div>

I'm trying to use the \_boost field to boost certain documents while  
indexing (as even native scripting is a bit slow for me ;)). But when  
I'm searching with a query\_string query the \_boost field is not  
recognized (documents with a lot higher \_boost field come later).

Which query type recognizes the \_boost field?

Regards,  
Peter.

---

<div class="post-metadata">

**Author:** ![Karussell1](https://avatars.discourse-cdn.com/v4/letter/k/50afbb/32.png) [@Karussell1](https://discuss.elastic.co/u/Karussell1)\
**Post date:** [June 10, 2011, 9:56pm UTC](https://discuss.elastic.co/t/understanding-how-to-use-the-indexed--boost-field/4591/2 "2011-06-10T21:56:30Z")

</div>

It works, but for queries _:_ it does not. I opened an issue for  
this:

> <https://github.com/elastic/elasticsearch/issues/1019>
>
> When using boost field for every document and doing a query\_search with \_:\_ it… would be logically to simply sort against the boost value. At the moment every doc gets an identical score of 1

But maybe the workaround is too easy (in my case) and this issue not  
worth to be implemented ...

On Jun 9, 10:34 pm, Karussell [tableyourt...@googlemail.com](mailto:tableyourt...@googlemail.com) wrote:

> I'm trying to use the \_boost field to boost certain documents while  
> indexing (as even native scripting is a bit slow for me ;)). But when  
> I'm searching with a query\_string query the \_boost field is not  
> recognized (documents with a lot higher \_boost field come later).
> 
> Which query type recognizes the \_boost field?
> 
> Regards,  
> Peter.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [June 12, 2011, 7:17am UTC](https://discuss.elastic.co/t/understanding-how-to-use-the-indexed--boost-field/4591/3 "2011-06-12T07:17:30Z")

</div>

Yes, by default, the _:_ query is using a cached "constant" score result to improve perf. We can add a flag to it to have it do the fully term scanning, which will take boost into account, but it will be slower.

On Saturday, June 11, 2011 at 12:56 AM, Karussell wrote:

> It works, but for queries _:_ it does not. I opened an issue for  
> this:
> 
> [\_boost field should work for \*:\* too · Issue #1019 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/1019)
> 
> But maybe the workaround is too easy (in my case) and this issue not  
> worth to be implemented ...
> 
> On Jun 9, 10:34 pm, Karussell \<[tableyourt...@googlemail.com](mailto:tableyourt...@googlemail.com) ([http://googlemail.com](http://googlemail.com))\> wrote:
> 
> > I'm trying to use the \_boost field to boost certain documents while  
> > indexing (as even native scripting is a bit slow for me ;)). But when  
> > I'm searching with a query\_string query the \_boost field is not  
> > recognized (documents with a lot higher \_boost field come later).
> > 
> > Which query type recognizes the \_boost field?
> > 
> > Regards,  
> > Peter.

---

<div class="post-metadata">

**Author:** ![Yannick\_Smits\_2](https://avatars.discourse-cdn.com/v4/letter/y/a4c791/32.png) [@Yannick\_Smits\_2](https://discuss.elastic.co/u/Yannick_Smits_2)\
**Post date:** [June 15, 2011, 11:01am UTC](https://discuss.elastic.co/t/understanding-how-to-use-the-indexed--boost-field/4591/4 "2011-06-15T11:01:39Z")

</div>

I’m trying to understand the below discussion. Can someone help me explain what a _:_ query is?

From: Shay Banon [[mailto:shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)]  
Sent: zondag 12 juni 2011 9:18  
To: [users@elasticsearch.com](mailto:users@elasticsearch.com)  
Subject: Re: Understanding how to use the indexed \_boost field

Yes, by default, the _:_ query is using a cached "constant" score result to improve perf. We can add a flag to it to have it do the fully term scanning, which will take boost into account, but it will be slower.

On Saturday, June 11, 2011 at 12:56 AM, Karussell wrote:

It works, but for queries _:_ it does not. I opened an issue for  
this:

> <https://github.com/elastic/elasticsearch/issues/1019>

But maybe the workaround is too easy (in my case) and this issue not  
worth to be implemented ...

On Jun 9, 10:34 pm, Karussell [tableyourt...@googlemail.com](mailto:tableyourt...@googlemail.com) wrote:

I'm trying to use the \_boost field to boost certain documents while  
indexing (as even native scripting is a bit slow for me ;)). But when  
I'm searching with a query\_string query the \_boost field is not  
recognized (documents with a lot higher \_boost field come later).

Which query type recognizes the \_boost field?

Regards,  
Peter.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [June 15, 2011, 11:14am UTC](https://discuss.elastic.co/t/understanding-how-to-use-the-indexed--boost-field/4591/5 "2011-06-15T11:14:52Z")

</div>

Its a "match\_all" query.

On Wednesday, June 15, 2011 at 2:01 PM, Yannick Smits wrote:

> I’m trying to understand the below discussion. Can someone help me explain what a _:_ query is?
> 
> From: Shay Banon [[mailto:shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)]  
> Sent: zondag 12 juni 2011 9:18  
> To: [users@elasticsearch.com](mailto:users@elasticsearch.com) ([mailto:users@elasticsearch.com](mailto:users@elasticsearch.com))  
> Subject: Re: Understanding how to use the indexed \_boost field
> 
> Yes, by default, the _:_ query is using a cached "constant" score result to improve perf. We can add a flag to it to have it do the fully term scanning, which will take boost into account, but it will be slower.  
> On Saturday, June 11, 2011 at 12:56 AM, Karussell wrote:
> 
> > It works, but for queries _:_ it does not. I opened an issue for  
> > this:
> > 
> > [\_boost field should work for \*:\* too · Issue #1019 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/1019)
> > 
> > But maybe the workaround is too easy (in my case) and this issue not  
> > worth to be implemented ...
> > 
> > On Jun 9, 10:34 pm, Karussell \<[tableyourt...@googlemail.com](mailto:tableyourt...@googlemail.com) ([http://googlemail.com](http://googlemail.com))\> wrote:
> > 
> > I'm trying to use the \_boost field to boost certain documents while  
> > indexing (as even native scripting is a bit slow for me ;)). But when  
> > I'm searching with a query\_string query the \_boost field is not  
> > recognized (documents with a lot higher \_boost field come later).
> > 
> > Which query type recognizes the \_boost field?
> > 
> > Regards,  
> > Peter.

---

<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, 4:03am UTC](https://discuss.elastic.co/t/understanding-how-to-use-the-indexed--boost-field/4591/6 "2017-07-06T04:03:31Z")

</div>


