# Field level boosting problem

**URL:** <https://discuss.elastic.co/t/field-level-boosting-problem/10821>\
**Category:** Elasticsearch\
**Created:** [February 20, 2013, 3:12pm UTC](https://discuss.elastic.co/t/field-level-boosting-problem/10821 "2013-02-20T15:12:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![markusos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/markusos/32/2479_2.png) [@markusos](https://discuss.elastic.co/u/markusos)\
**Post date:** [February 20, 2013, 3:12pm UTC](https://discuss.elastic.co/t/field-level-boosting-problem/10821/1 "2013-02-20T15:12:03Z")

</div>

Hi!

I'm trying to get field level boosting to work and have run into some  
problems.

I have set this mapping:

curl -XPUT '[http://localhost:9200/test/doc/\_mapping](http://localhost:9200/test/doc/_mapping)' -d '  
{  
"doc": {  
"name": "\_boost",  
"null\_value": 1  
},  
"val1" : {  
"type": "string"  
},  
"val2" : {  
"type": "string"  
}  
}  
}'

and the following documents:

curl -XPUT '[http://localhost:9200/test/doc/](http://localhost:9200/test/doc/)' -d '  
{  
"val1": {  
"\_value": "foo",  
"\_boost": 2.0  
},  
"val2": {  
"\_value": "bar",  
"\_boost": 1.0  
}  
}'

curl -XPUT '[http://localhost:9200/test/doc/](http://localhost:9200/test/doc/)' -d '  
{  
"val1": {  
"\_value": "foo",  
"\_boost": 1.0  
},  
"val2": {  
"\_value": "bar",  
"\_boost": 2.0  
}  
}'

curl -XPUT '[http://localhost:9200/test/doc/](http://localhost:9200/test/doc/)' -d '  
{  
"val1": {  
"\_value": "foo",  
"\_boost": 3.0  
},  
"val2": {  
"\_value": "bar",  
"\_boost": 2.0  
}  
}'

When doing the search:  
curl -XGET '[http://localhost:9200/test/doc/\_search?q=val1.\_value:foo](http://localhost:9200/test/doc/_search?q=val1._value:foo)'

I expect to get the last document withe the highest score,  
followed by the fist document and the second document to be inserted. But  
instead i get the same score on all three documents. What am I doing wrong?

I'm using ElasticSearch 0.20.4 - 2013-01-29.  
Found this ([https://github.com/elasticsearch/elasticsearch/issues/920](https://github.com/elasticsearch/elasticsearch/issues/920)) but  
it seemed to be implemented 2 years ago, so it should work in this version?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:50am UTC](https://discuss.elastic.co/t/field-level-boosting-problem/10821/2 "2017-07-06T02:50:31Z")

</div>


