Dynamic template (key/value mapping)

If i have a document like this:

document:
{
id:"11513",
title:"this is the title"
sections:
[
{
value:"This is the headline",
type:"headline"
},
{
value:"This is the body",
type:"body"
},
{
value:"Some One",
type:"author"
}
]
}

is it possible using dynamic_template so that the "type" under sections
will become the field name for the "value"?
e.g.
document.sections.body:"this is the body"

If so how would the mapping look like?

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/53ee5f97-08ee-462d-b217-776bfda9dd3f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No. You'd have to change the document before indexing it.

On 10 March 2014 08:14, Michael Gulliksen michael.gulliksen@gmail.comwrote:

If i have a document like this:

document:
{
id:"11513",
title:"this is the title"
sections:
[
{
value:"This is the headline",
type:"headline"
},
{
value:"This is the body",
type:"body"
},
{
value:"Some One",
type:"author"
}
]
}

is it possible using dynamic_template so that the "type" under sections
will become the field name for the "value"?
e.g.
document.sections.body:"this is the body"

If so how would the mapping look like?

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/53ee5f97-08ee-462d-b217-776bfda9dd3f%40googlegroups.comhttps://groups.google.com/d/msgid/elasticsearch/53ee5f97-08ee-462d-b217-776bfda9dd3f%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAPt3XKTGnWViDF0JEJERR42qHPomBYMAmGWMdR5Vnk2qY6dNzQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.