Collapse sort with normal sort in same query

Dear Guys
i am trying to make the following Query
{
"query": {
"bool": {
"must": [{ "terms":
{
"plugin_name.keyword":["5b39fa87c1fb830245e83b7a", "5b3b493bc1fb8307016e045f"]
}
}
],
"filter": {
"bool": {
"must": []
}
}
}
},"size": 3,
"from": 0,
"collapse": {
"field": "plugin_output.plate.keyword",
"inner_hits": {
"name": "latest_record",
"size": 1,
"sort": [
{
"timestamp": "DESC"
}
]
}
},
"sort": [
{
"timestamp": {
"order": "DESC"
}
}
],
"aggs": {
"total": {
"cardinality": {
"field": "plugin_output.plate.keyword"
}
}
}
}

the problem that the collapse doesn't work successfully when the sort of timestamp of the collapse is DESC order and the sort of timestamp of the main query is ASC
please help
Thanks in advance

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