Template mappings vs config mappings


(Colin Surprenant) #1

Hi,

If I have a default mapping for type "mytype" in
config/mappings/_default/mytype.json and I create a template with

{
"template" : "*",
"settings" : { ... },
"mappings" : {"mytype": { ... }}
}

whenever a new index is created, it seems that both mappings are
merged. Is this the intended behaviour? Is there a way to force the
template mapping over the config mapping without stopping the cluster?

Thanks,
Colin


(Shay Banon) #2

Yes, this is the intended behavior. There is no option to force one over the other aside from not using one of them.

On Tuesday, May 31, 2011 at 10:35 PM, Colin Surprenant wrote:

Hi,

If I have a default mapping for type "mytype" in
config/mappings/_default/mytype.json and I create a template with

{
"template" : "*",
"settings" : { ... },
"mappings" : {"mytype": { ... }}
}

whenever a new index is created, it seems that both mappings are
merged. Is this the intended behaviour? Is there a way to force the
template mapping over the config mapping without stopping the cluster?

Thanks,
Colin


(Colin Surprenant) #3

Ok, thanks.

Is there a way to get rid of the config mappings without restarting ES?

Colin

On Tue, May 31, 2011 at 7:22 PM, Shay Banon
shay.banon@elasticsearch.com wrote:

Yes, this is the intended behavior. There is no option to force one over the
other aside from not using one of them.

On Tuesday, May 31, 2011 at 10:35 PM, Colin Surprenant wrote:

Hi,

If I have a default mapping for type "mytype" in
config/mappings/_default/mytype.json and I create a template with

{
"template" : "*",
"settings" : { ... },
"mappings" : {"mytype": { ... }}
}

whenever a new index is created, it seems that both mappings are
merged. Is this the intended behaviour? Is there a way to force the
template mapping over the config mapping without stopping the cluster?

Thanks,
Colin


(Shay Banon) #4

You can just delete them, they are read on demand when the index is created.

On Wednesday, June 1, 2011 at 4:59 PM, Colin Surprenant wrote:

Ok, thanks.

Is there a way to get rid of the config mappings without restarting ES?

Colin

On Tue, May 31, 2011 at 7:22 PM, Shay Banon
<shay.banon@elasticsearch.com (mailto:shay.banon@elasticsearch.com)> wrote:

Yes, this is the intended behavior. There is no option to force one over the
other aside from not using one of them.

On Tuesday, May 31, 2011 at 10:35 PM, Colin Surprenant wrote:

Hi,

If I have a default mapping for type "mytype" in
config/mappings/_default/mytype.json and I create a template with

{
"template" : "*",
"settings" : { ... },
"mappings" : {"mytype": { ... }}
}

whenever a new index is created, it seems that both mappings are
merged. Is this the intended behaviour? Is there a way to force the
template mapping over the config mapping without stopping the cluster?

Thanks,
Colin


(system) #5