Boost field issues

When using the boost field feature (
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 (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

--

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 wrote:

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

--

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 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 wrote:

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

--