From 7.13 we introduced a queryable metadata field which is the _tier
field and represents the allocation routing preference(s) assigned to an index. Of course a preference is just that and in reality an index may not be held on its preferred choice of hot/warm etc but in practice you would hope most of the time this choice would be fulfilled.
To get a list of indices which have a stated preference to be on hot nodes you'd need something like this:
GET /*/_search
{
"query": {
"terms": {
"_tier": ["data_hot"]
}
},
"size":0,
"aggs":{
"indices":{
"terms": {
"field": "_index",
"size": 100
}
}
}
}