# How can I select arrays data?

**URL:** <https://discuss.elastic.co/t/how-can-i-select-arrays-data/370054>\
**Category:** Elastic Search\
**Tags:** esql\
**Created:** [November 5, 2024, 7:41am UTC](https://discuss.elastic.co/t/how-can-i-select-arrays-data/370054 "2024-11-05T07:41:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gerrard81](https://avatars.discourse-cdn.com/v4/letter/g/9de053/32.png) [@Gerrard81](https://discuss.elastic.co/u/Gerrard81)\
**Post date:** [November 5, 2024, 7:41am UTC](https://discuss.elastic.co/t/how-can-i-select-arrays-data/370054/1 "2024-11-05T07:41:25Z")

</div>

I have data that is stored in the form of Arrays.

POST \_sql?format=json

```auto
{
  "query": """SELECT components.keyword FROM "issue" WHERE resolution_date >= '2023-12-31T15:00:00Z' AND resolution_date < '2024-11-04T00:19:00Z' """,
  "fetch_size": 10000
}

```

When I try to retrieve it with the above query statement, I get the following error.

"Arrays (returned by [components.keyword]) are not supported"

Is there any other good way to do this?

---

<div class="post-metadata">

**Author:** ![RabBit\_BR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rabbit_br/32/82261_2.png) [@RabBit\_BR](https://discuss.elastic.co/u/RabBit_BR)\
**Post date:** [November 6, 2024, 12:16am UTC](https://discuss.elastic.co/t/how-can-i-select-arrays-data/370054/2 "2024-11-06T00:16:55Z")

</div>

Hi @Gerrard81 , welcome!!

I don't know which version of ES you use, but with ES|QL you can create a query to get the array:  
Ex:

```auto
POST _query?format=txt
{
    "query": """
    FROM issue
    | WHERE resolution_date >= "2023-12-31T15:00:00Z" AND resolution_date < "2024-11-04T00:19:00Z"
    """
}

```

Using SQL API you have the [array limitation](https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-limitations.html#_array_type_of_fields). See about [field\_multi\_value\_leniency](https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-search-api.html#sql-search-api-request-body).

---

<div class="post-metadata">

**Author:** ![Gerrard81](https://avatars.discourse-cdn.com/v4/letter/g/9de053/32.png) [@Gerrard81](https://discuss.elastic.co/u/Gerrard81)\
**Post date:** [November 7, 2024, 4:05am UTC](https://discuss.elastic.co/t/how-can-i-select-arrays-data/370054/3 "2024-11-07T04:05:06Z")

</div>

Thank you, I was able to solve the problem.

---

<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:** [December 5, 2024, 4:05am UTC](https://discuss.elastic.co/t/how-can-i-select-arrays-data/370054/4 "2024-12-05T04:05:53Z")

</div>

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