# Queries against all fields with boosting

**URL:** <https://discuss.elastic.co/t/queries-against-all-fields-with-boosting/7297>\
**Category:** Elasticsearch\
**Created:** [April 11, 2012, 3:30pm UTC](https://discuss.elastic.co/t/queries-against-all-fields-with-boosting/7297 "2012-04-11T15:30:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mkleen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mkleen/32/1694_2.png) [@mkleen](https://discuss.elastic.co/u/mkleen)\
**Post date:** [April 11, 2012, 3:30pm UTC](https://discuss.elastic.co/t/queries-against-all-fields-with-boosting/7297/1 "2012-04-11T15:30:44Z")

</div>

Hello,

I want to create a query against all fields my index. Therefore the  
\_all field becomes handy here. I was wondering if I having boosting in  
my mapping included, will the boost still work in the \_all field ?  
E.g.

curl -XPUT [http://localhost:9200/test/data/\_mapping](http://localhost:9200/test/data/_mapping) -d '{  
"contact": {  
"name" : {  
"boost" : "3.0",  
"include\_in\_all" : "true"  
},  
"data" : {  
"boost" : "1.0",  
"include\_in\_all" : "true"  
}  
}  
}'

So does it mean in this case that the specific boost for the 2 fields  
is also taken independently over to the \_all field ?

Many thanks,

Michael

---

<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:** [April 13, 2012, 12:09pm UTC](https://discuss.elastic.co/t/queries-against-all-fields-with-boosting/7297/2 "2012-04-13T12:09:48Z")

</div>

Yes, boosted fields will also be boosted in \_all.

On Wed, Apr 11, 2012 at 6:30 PM, mkleen [mkleen@gmail.com](mailto:mkleen@gmail.com) wrote:

> Hello,
> 
> I want to create a query against all fields my index. Therefore the  
> \_all field becomes handy here. I was wondering if I having boosting in  
> my mapping included, will the boost still work in the \_all field ?  
> E.g.
> 
> curl -XPUT [http://localhost:9200/test/data/\_mapping](http://localhost:9200/test/data/_mapping) -d '{  
> "contact": {  
> "name" : {  
> "boost" : "3.0",  
> "include\_in\_all" : "true"  
> },  
> "data" : {  
> "boost" : "1.0",  
> "include\_in\_all" : "true"  
> }  
> }  
> }'
> 
> So does it mean in this case that the specific boost for the 2 fields  
> is also taken independently over to the \_all field ?
> 
> Many thanks,
> 
> Michael

---

<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:32am UTC](https://discuss.elastic.co/t/queries-against-all-fields-with-boosting/7297/3 "2017-07-06T03:32:43Z")

</div>


