| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 | [[mapping-boost-field]]=== `_boost`deprecated[1.0.0.RC1,See <<function-score-instead-of-boost>>]Boosting is the process of enhancing the relevancy of a document orfield. Field level mapping allows to define an explicit boost level on aspecific field. The boost field mapping (applied on the<<mapping-root-object-type,root object>>) allowsto define a boost field mapping where *its content will control theboost level of the document*. For example, consider the followingmapping:[source,js]--------------------------------------------------{    "tweet" : {        "_boost" : {"name" : "my_boost", "null_value" : 1.0}    }}--------------------------------------------------The above mapping defines a mapping for a field named `my_boost`. If the`my_boost` field exists within the JSON document indexed, its value willcontrol the boost level of the document indexed. For example, thefollowing JSON document will be indexed with a boost value of `2.2`:[source,js]--------------------------------------------------{    "my_boost" : 2.2,    "message" : "This is a tweet!"}--------------------------------------------------[[function-score-instead-of-boost]]==== Function score instead of boostSupport for document boosting via the `_boost` field has been removedfrom Lucene and is deprecated in Elasticsearch as of v1.0.0.RC1. Theimplementation in Lucene resulted in unpredictable result whenused with multiple fields or multi-value fields.Instead, the <<query-dsl-function-score-query>> can be used to achievethe desired functionality by boosting each document by the value inany field of the document:[source,js]--------------------------------------------------{    "query": {        "function_score": {            "query": {  <1>                "match": {                    "title": "your main query"                }            },            "functions": [{                "field_value_factor": { <2>                    "field": "my_boost_field"                }            }],            "score_mode": "multiply"        }    }}--------------------------------------------------<1> The original query, now wrapped in a `function_score` query.<2> This function returns the value in `my_boost_field`, which is then    multiplied by the query `_score` for each document.Note, that `field_value_factor` is a 1.2.x feature.
 |