Nested filter with multiple term queries

I'm trying to use elasticsearch(6.7) sorting with multiple term queries. But it doesn't sort data when there are 3 term queries. It works when I specify only

 {
    "term": {
       "instance.instFields.sourceFieldId": {
         "value": "16044"
       }
    }
 },

Below is the sort query with all 3 terms.

"sort": [
    {
        "instance.instFields.fieldDate": {
            "order": "desc",
            "nested_path": "instance.instFields",
            "nested_filter": {
                "bool": {
                    "must": [
                        {
                            "term": {
                                "instance.instFields.sourceFieldId": {
                                    "value": "16044"
                                }
                            }
                        },
                        {
                            "term": {
                                "instance.dataSourceId": {
                                    "value": "819"
                                }
                            }
                        },
                        {
                            "term": {
                                "instance.dsTypeId": {
                                    "value": "2301"
                                }
                            }
                        }
                    ]
                }
            }
        }
    }
],

Appreciate any help to resolve this issue.

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