Elasticsearch nested sorting is not working

I want to sort below query based on responseDate:
And every time I am returning some wrong BIG_INTEGER in sort with each data. I think nested sort is not working properly. Kindly help:

{
  "size": 1000,
  "query": {
    "bool": {
      "must": [
        
        {
          "nested": {
            "path": "data",
            "query": {
              "nested": {
                "path": "data.sec",
                "query": {
                  "nested": {
                    "path": "data.sec.dataQuestions",
                    "query": {
                      "nested": {
                        "path": "data.sec.dataQuestions.question",
                        "query": {
                          "nested": {
                            "path": "data.sec.dataQuestions.question.answer",
                            "query": {
                              "exists": {
                                "field": "data.sec.dataQuestions.question.answer.other"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
              ]
    }
  },
    "sort": {
"data.responseDate": {
"order": "asc"
}
},
   
  "_source": [
    "data.sec.dataQuestions.question.answer.other",
    "data.sec.dataQuestions.question.title"
  ]
}
~~

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