# Confuse with Array

**URL:** <https://discuss.elastic.co/t/confuse-with-array/167780>\
**Category:** Elasticsearch\
**Created:** [February 11, 2019, 1:24am UTC](https://discuss.elastic.co/t/confuse-with-array/167780 "2019-02-11T01:24:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![david\_loh](https://avatars.discourse-cdn.com/v4/letter/d/a4c791/32.png) [@david\_loh](https://discuss.elastic.co/u/david_loh)\
**Post date:** [February 11, 2019, 1:24am UTC](https://discuss.elastic.co/t/confuse-with-array/167780/1 "2019-02-11T01:24:33Z")

</div>

Hello guys,

I'm trying to learn Elasticsearh and I'm getting confused with Array data types.

I have define 2 text type fields and I have put some test data in to the index. To my surprise, the index accept combination of text and numeric.

I'm getting confuse to understand this ([https://www.elastic.co/guide/en/elasticsearch/reference/6.5/array.html](https://www.elastic.co/guide/en/elasticsearch/reference/6.5/array.html))

Am I misunderstand something here ?

Here is my index mapping

```
{
  "david_idx" : {
    "mappings" : {
      "_doc" : {
        "properties" : {
          "fav" : {
            "type" : "text"
          },
          "name" : {
            "type" : "text"
          }
        }
      }
    }
  }
}

```

And it seems like 'fav' can hold more than just text.

I have insert it as single text

```
  {
    "_index" : "david_idx",
    "_type" : "_doc",
    "_id" : "zWNZy2gBOusqcldvSZ8J",
    "_score" : 1.0,
    "_source" : {
      "name" : "first test",
      "fav" : "apple"
    }
  },

```

and Array

```
  {
    "_index" : "david_idx",
    "_type" : "_doc",
    "_id" : "I2Nay2gBOusqcldvlKED",
    "_score" : 1.0,
    "_source" : {
      "name" : "second test",
      "fav" : [
        "apple",
        "orange"
      ]
    }
  },

```

a numeric field

```
  {
    "_index" : "david_idx",
    "_type" : "_doc",
    "_id" : "JXH-2WgBOusqcldvzl8j",
    "_score" : 1.0,
    "_source" : {
      "name" : "fifth test",
      "fav" : 1
    }
  },

```

even array of nummeric

```
  {
    "_index" : "david_idx",
    "_type" : "_doc",
    "_id" : "vXH_2WgBOusqcldvTl8R",
    "_score" : 1.0,
    "_source" : {
      "name" : "sixth test - number test",
      "fav" : [
        99,
        98,
        97
      ]
    }
  },

```

and mixture of text andm numeric.

```
  {
    "_index" : "david_idx",
    "_type" : "_doc",
    "_id" : "LHEL2mgBOusqcldvEmu1",
    "_score" : 1.0,
    "_source" : {
      "name" : "seventh test",
      "fav" : [
        5,
        "banana"
      ]
    }
  }
```

---

<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:** [March 11, 2019, 1:24am UTC](https://discuss.elastic.co/t/confuse-with-array/167780/2 "2019-03-11T01:24:38Z")

</div>

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