Inheritance of mappings

Hi,

is it possible to have kind of inheritance in a mapping. That means that
properties in specific type are added to properties of default?

Examle:
{
"settings": {
"mapper" : {
"dynamic": false
},
"index": {
"analysis": {
"analyzer": {
"string_analyzer_index": {
"type": "custom",
"tokenizer": "standard",
"filter": ["asciifolding", "lowercase", "name_ngram"]
}
},
"filter": {
"name_ngram": {
"type": "edgeNGram",
"min_gram": 1,
"max_gram": 20,
"side": "front"
}
}
}
}
},
"mappings": {
"default": {
"properties": {
"generalProperty01": {
"type": "object"
},
"generalProperty02": {
"type": "string"
}
},
"dynamic_templates": [
{
"name_template": {
"path_match": "generalProperty01.*",
"mapping": {
"type": "string",
"include_in_all": false,
"analyzer": "string_analyzer_index"
}
}
]
},
"mySpecialEntity01": {
"properties": {
"specialEntity01Property01": {
"type": "string"
}
}
},
"mySpecialEntity02": {
}
}
}

Thanks in advance!
Bjoern

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

I think your current solution of using dynamic templates and path matching
is the only way to go, AFAIK.

--
Ivan

On Tue, May 28, 2013 at 5:46 AM, Bjoern Zapadlo bjoern.zapadlo@gmail.comwrote:

Hi,

is it possible to have kind of inheritance in a mapping. That means that
properties in specific type are added to properties of default?

Examle:
{
"settings": {
"mapper" : {
"dynamic": false
},
"index": {
"analysis": {
"analyzer": {
"string_analyzer_index": {
"type": "custom",
"tokenizer": "standard",
"filter": ["asciifolding", "lowercase", "name_ngram"]
}
},
"filter": {
"name_ngram": {
"type": "edgeNGram",
"min_gram": 1,
"max_gram": 20,
"side": "front"
}
}
}
}
},
"mappings": {
"default": {
"properties": {
"generalProperty01": {
"type": "object"
},
"generalProperty02": {
"type": "string"
}
},
"dynamic_templates": [
{
"name_template": {
"path_match": "generalProperty01.*",
"mapping": {
"type": "string",
"include_in_all": false,
"analyzer": "string_analyzer_index"
}
}
]
},
"mySpecialEntity01": {
"properties": {
"specialEntity01Property01": {
"type": "string"
}
}
},
"mySpecialEntity02": {
}
}
}

Thanks in advance!
Bjoern

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.