for example I have 2 indicies
- countries
- states
PUT /countries/_mapping
{
"dynamic" : "strict",
"properties" : {
"id" : {
"type" : "keyword"
},
"geo" : {
"type" : "geo_point"
},
"name" : {
"type" : "text"
},
"numberISO" : {
"type" : "integer"
}
}
}
PUT /states/_mapping
{
"dynamic" : "strict",
"properties" : {
"countryID" : {
"type" : "keyword"
},
"id" : {
"type" : "keyword"
},
"geo" : {
"type" : "geo_point"
},
"name" : {
"type" : "text"
},
"numberISO" : {
"type" : "integer"
}
}
}
JOIN on [“id”, “countryID”]
as a result I want to get a set of included documents, like this:
"hits" : [
{
"_index" : "countries",
"_type" : "_doc",
"_id" : "1",
"_score" : 1.0,
"_source" : {
id: '1',
...
},
"fields" : {
"states" : [
{
"countryID": '1',
"id": '2',
"numberISO": 123
},
{
"countryID": '1',
"id": '3',
"numberISO": 345
},
...
]
}
}
]