# Query nth element of an array

**URL:** <https://discuss.elastic.co/t/query-nth-element-of-an-array/87491>\
**Category:** Kibana\
**Created:** [May 29, 2017, 9:22pm UTC](https://discuss.elastic.co/t/query-nth-element-of-an-array/87491 "2017-05-29T21:22:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hahe](https://avatars.discourse-cdn.com/v4/letter/h/fbc32d/32.png) [@hahe](https://discuss.elastic.co/u/hahe)\
**Post date:** [May 29, 2017, 9:22pm UTC](https://discuss.elastic.co/t/query-nth-element-of-an-array/87491/1 "2017-05-29T21:22:52Z")

</div>

I've got json documents as follows:

```
{
  "_index": "x",
  "_type": "y",
  "_id": "z",
  "_version": 1,
  "found": true,
  "_source": {
	"request": {
	  "segmentList": [
		{
		  "departure": {
			"code": "JFK"
		  },
		  "destination": {
			"code": "LAX"
		  },
		  "departureDate": "2017-06-14"
		},
		{
		  "departure": {
			"code": "LAX"
		  },
		  "destination": {
			"code": "JFK"
		  },
		  "departureDate": "2017-06-28"
		}
	  ]
	}
  }
}

```

Is there any way i can search in kibana for first departureDate="2017-06-14" and second departureDate="2017-06-28" ?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 30, 2017, 3:02am UTC](https://discuss.elastic.co/t/query-nth-element-of-an-array/87491/2 "2017-05-30T03:02:32Z")

</div>

There's not because we cannot guarantee the order of response, see [Order of aggregations](https://discuss.elastic.co/t/order-of-aggregations/86904/2)

---

<div class="post-metadata">

**Author:** ![hahe](https://avatars.discourse-cdn.com/v4/letter/h/fbc32d/32.png) [@hahe](https://discuss.elastic.co/u/hahe)\
**Post date:** [May 30, 2017, 1:16pm UTC](https://discuss.elastic.co/t/query-nth-element-of-an-array/87491/3 "2017-05-30T13:16:09Z")

</div>

ok, understood - thanks for the info!

---

<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:** [June 27, 2017, 1:16pm UTC](https://discuss.elastic.co/t/query-nth-element-of-an-array/87491/4 "2017-06-27T13:16:16Z")

</div>

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