# Boost filed

**URL:** <https://discuss.elastic.co/t/boost-filed/8465>\
**Category:** Elasticsearch\
**Created:** [July 19, 2012, 10:56am UTC](https://discuss.elastic.co/t/boost-filed/8465 "2012-07-19T10:56:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![subhash](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@subhash](https://discuss.elastic.co/u/subhash)\
**Post date:** [July 19, 2012, 10:56am UTC](https://discuss.elastic.co/t/boost-filed/8465/1 "2012-07-19T10:56:17Z")

</div>

Hi,

I have referred below link

[http://www.elasticsearch.org/guide/reference/mapping/boost-field.html](http://www.elasticsearch.org/guide/reference/mapping/boost-field.html)

Still I have doubt on the same.

Below is my scenario

Index is : employees

{

"settings": {"number\_of\_shards": 3, "number\_of\_replica": 0},

"mappings": {

```
"employee": {

  "_source": {"enabled": true},

  "properties": {"name": {"type": "string"},"surname": {"type": 

```

"string"},"phone": {"type": "string"}

} } } }

Now please help me how I can apply a boost level on _surname_.

I was trying below script, but is not working for me ☹

{

"settings": {"number\_of\_shards": 3, "number\_of\_replica": 0},

"mappings": {

```
"employee": {

  "_source": {"enabled": true},

"_boost": {"name": "*surname*","null_value": 2},

  "properties": {"name": {"type": "string"},"*surname*": {"type": 

```

"string"},"phone": {"type": "string"}

} } } }

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [July 20, 2012, 7:14pm UTC](https://discuss.elastic.co/t/boost-filed/8465/2 "2012-07-20T19:14:47Z")

</div>

The \_boost setting is used to indicate which field contains the value  
to boost the score of the entire document. This field should be a  
numerical value, not a string like surname.

What exactly are you trying to achieve? Are you trying to boost based  
on the value the surname? If so, you can boost the field within your  
indexing code or boost at query time  
([Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/query-dsl/boosting-query.html)),

--  
Ivan

On Thu, Jul 19, 2012 at 3:56 AM, subhash [mksubhashnambiar@gmail.com](mailto:mksubhashnambiar@gmail.com) wrote:

> Hi,
> 
> I have referred below link
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/boost-field.html)
> 
> Still I have doubt on the same.
> 
> Below is my scenario
> 
> Index is : employees
> 
> {
> 
> "settings": {"number\_of\_shards": 3, "number\_of\_replica": 0},
> 
> "mappings": {
> 
> ```
> "employee": {
> 
> "_source": {"enabled": true},
> 
> "properties": {"name": {"type": "string"},"surname": {"type":
> 
> ```
> 
> "string"},"phone": {"type": "string"}
> 
> } } } }
> 
> Now please help me how I can apply a boost level on surname.
> 
> I was trying below script, but is not working for me ☹
> 
> {
> 
> "settings": {"number\_of\_shards": 3, "number\_of\_replica": 0},
> 
> "mappings": {
> 
> ```
> "employee": {
> 
> "_source": {"enabled": true},
> 
> "_boost": {"name": "surname","null_value": 2},
> 
> "properties": {"name": {"type": "string"},"surname": {"type":
> 
> ```
> 
> "string"},"phone": {"type": "string"}
> 
> } } } }

---

<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:19am UTC](https://discuss.elastic.co/t/boost-filed/8465/3 "2017-07-06T03:19:37Z")

</div>


