# Sort by nested-nested where parent has type

**URL:** <https://discuss.elastic.co/t/sort-by-nested-nested-where-parent-has-type/104540>\
**Category:** Elasticsearch\
**Created:** [October 19, 2017, 10:49am UTC](https://discuss.elastic.co/t/sort-by-nested-nested-where-parent-has-type/104540 "2017-10-19T10:49:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bolandish](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bolandish/32/23185_2.png) [@Bolandish](https://discuss.elastic.co/u/Bolandish)\
**Post date:** [October 19, 2017, 10:49am UTC](https://discuss.elastic.co/t/sort-by-nested-nested-where-parent-has-type/104540/1 "2017-10-19T10:49:07Z")

</div>

How do i sort these people by **attributes.values.value** where **attribute.type** is " **_score_**"??  
I really can't figure it out. My data structure :

```
[
  {
    name: "Thomas Bolander",
    attributes: [
      {
        type: "score",
        values: [{value: 2},{value: 5}]
      },
      {
        type: "weight",
        values: [{value: 80}]
      }
    ]
  },
  {
    name: "Kristian Vassard",
    attributes: [
      {
        type: "score",
        values: [{value: 7}, {value: 8 }]
      },
      {
        type: "age",
        values: [{value: 18}]
      }
    ]
  },
  {
    name: "Rune Sønderby",
    attributes: [
      {
        type: "score",
        values: [{value: 1}]
      }
    ]
  },
  {
    name: "Ronnie Faust",
    attributes: [
     
    ]
  }
]
```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 16, 2017, 10:49am UTC](https://discuss.elastic.co/t/sort-by-nested-nested-where-parent-has-type/104540/2 "2017-11-16T10:49:07Z")

</div>

Closed on November 16, 2017, 10:49am UTC

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