Upgrading a field to multi-field doesn't work


#1

Hi,

Need some help in figuring out how to upgrade a field to multi-field properly. I am using Elasticsearch-1.7.2 on linux.

Here is the put json

{
    "filelog": {
        "properties": {
            "signals": {
                "type": "multi_field",
                "fields": {
                    "signals": {
                        "type": "string",
                        "index": "analyzed"
                    },
                    "raw": {
                        "index": "not_analyzed",
                        "type": "string"
                    }
                }
            }
        }
    }
}

But doing get, I get the following field-definition back

{
    ....  `"signals": {
        "type": "string",
        "fields": {
            "raw": {
                "index": "not_analyzed",
                "type": "string"
            }
        }
    }
}

Note that the type has changed to "string" instead of multi-field, and there is no "signals" field in the "fields" section. When I query for signals.raw it doesn't work either.

What did I do wrong while updating the mapping?

Thanks,
Dash.


(David Pilato) #2

The later is the right way to define multifield.
Elasticsearch has just accepted the "old" form and adapted it to the new form.

Did you reindex your documents then?


#3

Thanks David. The syntax makes sense now, I must have been looking at the old documentation all this while.

I didn't reindex - I was hoping that I didn't have to do it for only "upgrading" the mapping. That turns out to be a false assumption.

Thanks for the response.


(system) #4