I am unable to create a custom mapping for "hashtags," which is a subfield of "twitter_entities" in elasticsearch. I tried to do it in the following ways:
{
"mappings": {
"tweet" : {
"properties": {
"twitter_entities.hashtags" : {
"type" : "multi_field",
"fields" : {
"hashtag" : {
"type" : "string",
"analyzer" : "hashtag"
},
"autocomplete" : {
"type" : "string",
"index_analyzer" : "hashtag_autocomplete",
"search_analyzer" : "hashtag"
}
}
}
}
}
}
}
This creates another root field called "twitter_entities.hashtags"
{
"mappings": {
"tweet" : {
"properties": {
"hashtags" : {
"type" : "multi_field",
"fields" : {
"hashtag" : {
"type" : "string",
"analyzer" : "hashtag"
},
"autocomplete" : {
"type" : "string",
"index_analyzer" : "hashtag_autocomplete",
"search_analyzer" : "hashtag"
}
}
}
}
}
}
}
and
{
"mappings": {
"tweet" : {
"properties": {
"_parent" : {"type" : "twitter_entities" },
"hashtags" : {
"type" : "multi_field",
"fields" : {
"hashtag" : {
"type" : "string",
"analyzer" : "hashtag"
},
"autocomplete" : {
"type" : "string",
"index_analyzer" : "hashtag_autocomplete",
"search_analyzer" : "hashtag"
}
}
}
}
}
}
}
both just create another root field called "hashtags".
I am unable to find any documentation in the elasticsearch api or forums about doing this. Could anyone point me in the right direction?