Hi Shay
I have documents of this type as listed under https://gist.github.com/661688
I was wondering if I could create mappings for fields that follow a
certain pattern, as against ES determining dynamically how to index,
store etc those fields. As an example, I want all the nested field
values under "tags" section/object in the documents to all be treated
as Strings. So I am looking to define a mapping like the following.
Note the "*" below under "tags".
{
"video" : {
"dynamic" : true,
"enabled" : true,
"date_formats" : [
"dateOptionalTime",
"yyyy/MM/dd HH:mm:ss||yyyy/MM/dd"
],
"_source" : {
"enabled" : true,
"compress" : true,
"name" : "_source"
},
"properties" : {
"itemType" : {
"store" : "yes",
"type" : "string"
},
"userDate" : {
"store" : "yes",
"format" : "dateOptionalTime",
"type" : "date"
},
"tags" : {
"properties" : {
"*" : {
"properties" : {
"value" : {
"type" : "string"
},
"displayName" : {
"type" : "string"
}
},
"type" : "object"
}
}
}
},
"_all" : {
"enabled" : true,
"store" : "no",
"term_vector" : "no"
},
"type" : "object"
}
}
So whenever, a document would have, something like the following tags
object, all the object values listed under combined_media_state/
player_id/team_id, would be treated as strings as against dynamically
decided by ES like integer for player_id.value
"tags" : {
"combined_media_state" : [ {
"value" : "MEDIA_ON",
"displayName" : "MEDIA_ON"
} ],
"weight" : [ {
"value" : "1",
"displayName" : "1"
} ],
"subject" : [ {
"value" : "MLBCOM_FEATURE",
"displayName" : "MLBCOM_FEATURE"
} ],
"mlbtax" : [ {
"value" : "mm_hightlight_reel",
"displayName" : "highlight reel"
}, {
"value" : "home_run",
"displayName" : "home run"
} ],
"player_id" : [ {
"value" : "121347",
"displayName" : "Alex Rodriguez"
} ],
"team_id" : [ {
"value" : "147",
"displayName" : "New York Yankees"
} ]
}
I guess, this is probably not there right now. Would it be possible to
add this as a feature request or is it too much of a hassle?
Thanks
Diptamay