# How can i check if the value of the field is an array?

**URL:** https://discuss.elastic.co/t/how-can-i-check-if-the-value-of-the-field-is-an-array/285087
**Category:** Kibana
**Created:** [September 24, 2021, 2:15pm UTC](https://discuss.elastic.co/t/how-can-i-check-if-the-value-of-the-field-is-an-array/285087 "2021-09-24T14:15:31Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Aurel\_Drejta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aurel_drejta/32/59925_2.png) [@Aurel\_Drejta](https://discuss.elastic.co/u/Aurel_Drejta)
#### Post date: [September 24, 2021, 2:15pm UTC](https://discuss.elastic.co/t/how-can-i-check-if-the-value-of-the-field-is-an-array/285087/1 "2021-09-24T14:15:31Z")

</div>

Hi everyone,

By accident i inserted some values as arrays inside the index, when the actual value should have been a string.

This is the wrong value :

```auto
{
"hits" : [
      {
        "_index" : "en_file",
        "_type" : "_doc",
        "_id" : "I5nOLnkB0v90hg-Gubwb",
        "_score" : 10.830619,
        "_source" : {
          "url" : [
            "https://repository.dri.ie/objects/ws85q0866/files/x059rs54j?surrogate=pdf"
          ]
   }
}

```

When it should have been:

```auto
{
"hits" : [
      {
        "_index" : "en_file",
        "_type" : "_doc",
        "_id" : "I5nOLnkB0v90hg-Gubwb",
        "_score" : 10.830619,
        "_source" : {
          "url" : "https://repository.dri.ie/objects/ws85q0866/files/x059rs54j?surrogate=pdf"
   }
}

```

Any ideas how can i query values that are arrays and not as normal string?

---

<div class="post-metadata">

### Author: ![dosant](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dosant/32/64489_2.png) [@dosant](https://discuss.elastic.co/u/dosant)
#### Post date: [October 1, 2021, 1:22pm UTC](https://discuss.elastic.co/t/how-can-i-check-if-the-value-of-the-field-is-an-array/285087/2 "2021-10-01T13:22:48Z")

</div>

Kibana should query an array in similar manner, for example:

```auto
{
  "_index": "kibana_sample_data_ecommerce",
  "_id": "8gWDJnwBCYOiYwe6faLd",
  "_version": 1,
  "_score": 1,
  "_source": {
    "category": [
      "Men's Clothing",
      "Men's Accessories"
    ],

```

And KQL query in discover like `category.keyword : "Men's Accessories" ` will match this document

And es docs on querying and array type: [Arrays | Elasticsearch Guide [7.15] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/array.html)

---

<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: [October 29, 2021, 1:22pm UTC](https://discuss.elastic.co/t/how-can-i-check-if-the-value-of-the-field-is-an-array/285087/3 "2021-10-29T13:22:56Z")

</div>

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