Not allowed:
"mappings": {
"tweet": {
"properties": {
"innerTweet": {
"properties": {
"title": {
"type": "keyword"
},
"title": {
"type": "long"
}
}
}
}
}
}
"mappings": {
"tweet": {
"properties": {
"title": {
"type": "keyword"
},
},
},
"user": {
"properties": {
"title": {
"type": "long"
}
}
}
}
Allowed:
"mappings": {
"doc": {
"properties": {
"type": {
"type:" "keyword"
},
"tweet": {
"properties": {
"title": {
"type": "keyword"
},
},
},
"user": {
"properties": {
"title": {
"type": "long"
}
}
}
}
}
}
Creating:
POST /indexname/doc/tweet:abc123/_create
{
"type": "tweet",
"tweet": {
"title": "some keyword"
}
}
POST /indexname/doc/user:abc123/_create
{
"type": "user",
"tweet": {
"title": 23045987234
}
}
Getting:
GET /indexname/doc/tweet:abc123
{
"_type": "doc",
"_id": "tweet:abc123",
"_source": {
"type": "tweet",
"tweet": {
"title": "some keyword"
}
}
}
POST /indexname/doc/user:abc123
{
"_type": "doc",
"_id": "user:abc123",
"_source": {
"type": "user",
"tweet": {
"title": 23045987234
}
}
}