# Filtering, sorting and paginate nested object list

**URL:** <https://discuss.elastic.co/t/filtering-sorting-and-paginate-nested-object-list/279078>\
**Category:** Elasticsearch\
**Created:** [July 19, 2021, 2:26pm UTC](https://discuss.elastic.co/t/filtering-sorting-and-paginate-nested-object-list/279078 "2021-07-19T14:26:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nickcigna](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickcigna/32/142363_2.png) [@nickcigna](https://discuss.elastic.co/u/nickcigna)\
**Post date:** [July 19, 2021, 2:26pm UTC](https://discuss.elastic.co/t/filtering-sorting-and-paginate-nested-object-list/279078/1 "2021-07-19T14:26:14Z")

</div>

Hello everybody,  
I have an index that contains documents with the following structure.

```auto
///SHOWS INDEX
{
	"_id",
	"artists":[ -----> NESTED OBJECT LIST
		{
			"id": "1",
			"name": "text"
		},
		{
			"id": "2",
			"name": "text"
		}
	]
}

```

What I would like to do is get only the ID(unique) of the artist's nodes, where a simple query string matches with property "name", and then to sort by the property "name" and paginate the ID list.  
It's possible?

Best regards.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [July 21, 2021, 2:20pm UTC](https://discuss.elastic.co/t/filtering-sorting-and-paginate-nested-object-list/279078/2 "2021-07-21T14:20:02Z")

</div>

Take a look at the [nested field type](https://www.elastic.co/guide/en/elasticsearch/reference/7.13/nested.html) in combination with the [inner\_hits functionality](https://www.elastic.co/guide/en/elasticsearch/reference/7.13/inner-hits.html).

This however does not allow you to paginate. Hope this helps as a start.

---

<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:** [August 18, 2021, 2:20pm UTC](https://discuss.elastic.co/t/filtering-sorting-and-paginate-nested-object-list/279078/3 "2021-08-18T14:20:27Z")

</div>

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