# Boost field issues

**URL:** <https://discuss.elastic.co/t/boost-field-issues/10414>\
**Category:** Elasticsearch\
**Created:** [January 18, 2013, 8:03pm UTC](https://discuss.elastic.co/t/boost-field-issues/10414 "2013-01-18T20:03:13Z")\
**Posts on this page:** 4\
**Page:** 1

<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:** [January 18, 2013, 8:03pm UTC](https://discuss.elastic.co/t/boost-field-issues/10414/1 "2013-01-18T20:03:13Z")

</div>

When using the boost field feature (  
[http://www.elasticsearch.org/guide/reference/mapping/boost-field.html](http://www.elasticsearch.org/guide/reference/mapping/boost-field.html)), the  
original referenced field is not being saved/used correctly.

Reproduction: [https://gist.github.com/0cce882aee6990e172b1](https://gist.github.com/0cce882aee6990e172b1) (index metadata  
should be last)

Sorting on the boosted field, returns 0.0 as the sorted value.

{

"query" : {

```
"match_all" : { }

```

},

"sort" : [ {

"Boost" : {

```
  "order" : "desc"

}

```

} ]

}

{

...

"hits" : {

```
"total" : 4,

"max_score" : null,

"hits" : [ {

  "_index" : "test",

  "_type" : "test",

  "_id" : "1",

  "_score" : null, "_source" : {

"Boost": "25.0"

```

},

"sort" : [0.0]  
...

If you look at the index metadata, the original property is missing.

Haven't looked at the code. Will do so now.

Cheers,

Ivan

--

---

<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:** [January 18, 2013, 8:15pm UTC](https://discuss.elastic.co/t/boost-field-issues/10414/2 "2013-01-18T20:15:12Z")

</div>

By looking at the code, it was not too hard to figure out.

The defaults defined in BoostFieldMapper are

```
public static class Defaults extends NumberFieldMapper.Defaults {
    public static final String NAME = "_boost";
    public static final Float NULL_VALUE = null;
    public static final Field.Index INDEX = Field.Index.NO;
    public static final Field.Store STORE = Field.Store.NO;
}

```

The mapper will ignore any settings defined on the field. Can they be used  
as well? It would be easy to add it to the parse method, but not sure if  
there are implications.

Cheers,

Ivan

On Fri, Jan 18, 2013 at 12:03 PM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:

> Haven't looked at the code. Will do so now.

--

---

<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:** [January 18, 2013, 8:22pm UTC](https://discuss.elastic.co/t/boost-field-issues/10414/3 "2013-01-18T20:22:55Z")

</div>

The code has changed slightly (I am on 0.20RC2), but the issue remains:

```
public static class Defaults extends NumberFieldMapper.Defaults {
    public static final String NAME = "_boost";
    public static final Float NULL_VALUE = null;

    public static final FieldType FIELD_TYPE = new

```

FieldType(NumberFieldMapper.Defaults.FIELD\_TYPE);

```
    static {
        FIELD_TYPE.setIndexed(false);
        FIELD_TYPE.setStored(false);
    }
}

```

On Fri, Jan 18, 2013 at 12:15 PM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:

> By looking at the code, it was not too hard to figure out.
> 
> The defaults defined in BoostFieldMapper are
> 
> ```
> public static class Defaults extends NumberFieldMapper.Defaults {
> public static final String NAME = "_boost";
> public static final Float NULL_VALUE = null;
> public static final Field.Index INDEX = Field.Index.NO;
> public static final Field.Store STORE = Field.Store.NO;
> }
> 
> ```
> 
> The mapper will ignore any settings defined on the field. Can they be used  
> as well? It would be easy to add it to the parse method, but not sure if  
> there are implications.
> 
> Cheers,
> 
> Ivan
> 
> On Fri, Jan 18, 2013 at 12:03 PM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:
> 
> > Haven't looked at the code. Will do so now.

--

---

<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:55am UTC](https://discuss.elastic.co/t/boost-field-issues/10414/4 "2017-07-06T02:55:40Z")

</div>


