How to sort by different fields in different indices

Hi,
below is my query . here i want to sort the 'abc_class' by it's "classId" and also a different sort for another Index.

please advise is there any approach to achieve this.

Error 404: No Query found.

Below query i have tried and it's failing : -

GET abc_class,bad/_search
{
"aggs": {
"abc_class,bad": {
"terms": {
"field": "{_index}"
}
}
},
"sort": [
{
"abc_class.classId": {
"order": "desc"
}
}
],
"query": {
"bool": {
"should": [
{
"bool": {
"filter": [
{
"terms": {
"_index": [
"abc_class"
]
}
}
]
}
},
{
"bool": {
"filter": [
{
"terms": {
"_index": [
"bad"
]
}
}
]
}
}
]
}
}
}

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.