Has_child support sorting inner_hits

Does has_child support sorting inner_hits? I use sort ,but it doesn't work

Yes, it does. You can define an inner hits element with sort on a has_child query:

{
   "has_child": {
      ...
      "inner_hits": {
          "sort" : [
              {
                "your_field" : {
                    "order" : "asc"
                }
              }
          ]
      }
    }
}

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