# Updating boost values dynamically

**URL:** <https://discuss.elastic.co/t/updating-boost-values-dynamically/5682>\
**Category:** Elasticsearch\
**Created:** [October 25, 2011, 8:03pm UTC](https://discuss.elastic.co/t/updating-boost-values-dynamically/5682 "2011-10-25T20:03:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![invaderZYM](https://avatars.discourse-cdn.com/v4/letter/i/c0e974/32.png) [@invaderZYM](https://discuss.elastic.co/u/invaderZYM)\
**Post date:** [October 25, 2011, 8:03pm UTC](https://discuss.elastic.co/t/updating-boost-values-dynamically/5682/1 "2011-10-25T20:03:13Z")

</div>

Sorry for the noob question, but I seem to have a disconnect when it  
comes to mapping and boost values. Currently I use field level  
boosting in my mapping file like so

```
    "option.Antibody Products" : {
      "type" : "multi_field",
      "fields" : {
        "option.Antibody Products" : {
          "include_in_all" : true,
          "boost" : 4.0,
          "type" : "string"
        },
        "stored" : {
          "include_in_all" : false,
          "store" : "yes",
          "analyzer" : "lowercase_whitespace",
          "type" : "string"
        }
      }

```

and for that I have to manually go in and update the boost value in  
the mapping file. Is there a way I can update this value when I index  
the document? I've checked [http://www.elasticsearch.org/guide/reference/mapping/boost-field.html](http://www.elasticsearch.org/guide/reference/mapping/boost-field.html)  
but it seems to be updating the boost value of the document and not  
the individual fields.

Thanks for any and all help

---

<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:** [October 26, 2011, 3:10am UTC](https://discuss.elastic.co/t/updating-boost-values-dynamically/5682/2 "2011-10-26T03:10:30Z")

</div>

You can provide a custom boost value within the json, shown here (check at  
the end of the string section):  
[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/core-types.html). Note  
though, it will not work with multi field mapping sadly...

On Tue, Oct 25, 2011 at 10:03 PM, invaderZYM [zspliff@gmail.com](mailto:zspliff@gmail.com) wrote:

> Sorry for the noob question, but I seem to have a disconnect when it  
> comes to mapping and boost values. Currently I use field level  
> boosting in my mapping file like so
> 
> ```
> "option.Antibody Products" : {
> "type" : "multi_field",
> "fields" : {
> "option.Antibody Products" : {
> "include_in_all" : true,
> "boost" : 4.0,
> "type" : "string"
> },
> "stored" : {
> "include_in_all" : false,
> "store" : "yes",
> "analyzer" : "lowercase_whitespace",
> "type" : "string"
> }
> }
> 
> ```
> 
> and for that I have to manually go in and update the boost value in  
> the mapping file. Is there a way I can update this value when I index  
> the document? I've checked  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/boost-field.html)  
> but it seems to be updating the boost value of the document and not  
> the individual fields.
> 
> Thanks for any and all help

---

<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:50am UTC](https://discuss.elastic.co/t/updating-boost-values-dynamically/5682/3 "2017-07-06T03:50:57Z")

</div>


