Copy_To an customize field


(Dionysus1016) #1

Hi All,
Can I customize filed name in dynamic template? For example, I have
fields like "twitter_title", "twitter_body","blog_title","blog_body" , and
there could be more fields with format "xxx_title","xxx_body" which are
added from front-end, then I want to map "xxx_title" and "xxx_body" to
"xxx", for example "twitter_title" to "twitter", are there any way for
this kind of mapping?

dynamic_templates" : [
{
"string_template" : {
"match" : "*_title",
"match_mapping_type" : "string",
"mapping" : {
"type" : "string",
"copy_to" : "target field name" # how
could I calculate target field name from {name}?
}

       }
     }                                                         
   ]

Thanks!
Jun

--
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/0ab472ee-bac1-4dd0-bbcd-83cd013f0e7e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #2