# How to work with a json array

**URL:** <https://discuss.elastic.co/t/how-to-work-with-a-json-array/67042>\
**Category:** Elasticsearch\
**Created:** [November 24, 2016, 12:12am UTC](https://discuss.elastic.co/t/how-to-work-with-a-json-array/67042 "2016-11-24T00:12:52Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![AussiePete2015](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aussiepete2015/32/13407_2.png) [@AussiePete2015](https://discuss.elastic.co/u/AussiePete2015)\
**Post date:** [November 24, 2016, 12:12am UTC](https://discuss.elastic.co/t/how-to-work-with-a-json-array/67042/1 "2016-11-24T00:12:52Z")

</div>

Hi all,

Environment  
Windows 7 64bit  
Elasticsearch, kibana, Logstash (5.0.0)

I have been trying to work with an example of a json array in the Elastic documentation but being new I'm not able to load it.  
Attach json example  
 ![](https://us1.discourse-cdn.com/elastic/original/2X/c/c9897776001e64da5c94711a2449f09daacadfc1.PNG)  
Attached index  
 ![](https://us1.discourse-cdn.com/elastic/original/2X/2/269767a813c45ddc2d29935c739fd70c85e7e1e0.PNG)  
Error when attempting to load via kibana  
{  
"error": {  
"root\_cause": [  
{  
"type": "illegal\_argument\_exception",  
"reason": "unknown setting [index.lists.0.description] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"  
}  
],  
"type": "illegal\_argument\_exception",  
"reason": "unknown setting [index.lists.0.description] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"  
},  
"status": 400  
}

So understanding that I'm fairly green with this, can anyone please provide me steps to correctly set this example up in elastic.

Cheers

---

<div class="post-metadata">

**Author:** ![guilherme\_maranhao](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guilherme_maranhao/32/101483_2.png) [@guilherme\_maranhao](https://discuss.elastic.co/u/guilherme_maranhao)\
**Post date:** [November 24, 2016, 2:34am UTC](https://discuss.elastic.co/t/how-to-work-with-a-json-array/67042/2 "2016-11-24T02:34:34Z")

</div>

Hi,

Have you tried removing the index\_name clause associated with the property "tags"?  
I'm not sure if this property is defined in an index mapping context.

kind regards,

Guilherme

---

<div class="post-metadata">

**Author:** ![guilherme\_maranhao](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guilherme_maranhao/32/101483_2.png) [@guilherme\_maranhao](https://discuss.elastic.co/u/guilherme_maranhao)\
**Post date:** [November 24, 2016, 3:21am UTC](https://discuss.elastic.co/t/how-to-work-with-a-json-array/67042/3 "2016-11-24T03:21:47Z")

</div>

If you remove it, you'll need to reindex your data.

---

<div class="post-metadata">

**Author:** ![AussiePete2015](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aussiepete2015/32/13407_2.png) [@AussiePete2015](https://discuss.elastic.co/u/AussiePete2015)\
**Post date:** [November 24, 2016, 4:00am UTC](https://discuss.elastic.co/t/how-to-work-with-a-json-array/67042/4 "2016-11-24T04:00:48Z")

</div>

Hi Guilherme

Tried and failed... doesn't like the list  
 ![](https://us1.discourse-cdn.com/elastic/original/2X/6/647e7c86d40348dbc598fabec2cafcf631761875.PNG)

I'm just not sure what I need to write to accommodate an array.  
I've used the example for Shakespeare just fine but the array has me beat.

Cheers for the assistance.

---

<div class="post-metadata">

**Author:** ![guilherme\_maranhao](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guilherme_maranhao/32/101483_2.png) [@guilherme\_maranhao](https://discuss.elastic.co/u/guilherme_maranhao)\
**Post date:** [November 24, 2016, 8:45am UTC](https://discuss.elastic.co/t/how-to-work-with-a-json-array/67042/5 "2016-11-24T08:45:19Z")

</div>

Have you followed the object reference? [https://www.elastic.co/guide/en/elasticsearch/reference/5.0/object.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/object.html)

According to the exception, it's something wrong with the description.type property. Just to test it, have you tried removing the types properties of the inner object. It doesn't seem to be the cause, but just to verify it.

---

<div class="post-metadata">

**Author:** ![AussiePete2015](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aussiepete2015/32/13407_2.png) [@AussiePete2015](https://discuss.elastic.co/u/AussiePete2015)\
**Post date:** [November 25, 2016, 12:36am UTC](https://discuss.elastic.co/t/how-to-work-with-a-json-array/67042/6 "2016-11-25T00:36:03Z")

</div>

Hi Guilherme

That link helped enormously  
Here's what I did in kibana

PUT /tweets  
{  
"mappings": {  
"tweet": {  
"properties": {  
"tweetid": { "type": "keyword" },  
"message": { "type": "text" },  
"tags": { "type": "text" },  
"content": {  
"properties": {  
"name": { "type": "text" },  
"msgbody": { "type": "text" }  
}  
}  
}  
}  
}  
}

DELETE /regmanagers  
PUT /regmanagers  
{  
"mappings": {  
"regmanagers": {  
"properties": {  
"region": { "type": "keyword" },  
"country": { "type": "text" },  
"manager": {  
"properties": {  
"age": { "type": "integer" },  
"name": { "type": "text" }  
}  
}  
}  
}  
}  
}  
}

This has worked as expected.  
Man so happy I understand now.

Cheers

---

<div class="post-metadata">

**Author:** ![AussiePete2015](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aussiepete2015/32/13407_2.png) [@AussiePete2015](https://discuss.elastic.co/u/AussiePete2015)\
**Post date:** [November 25, 2016, 2:17am UTC](https://discuss.elastic.co/t/how-to-work-with-a-json-array/67042/7 "2016-11-25T02:17:38Z")

</div>

Hi again

Thought I'd provide an update on this  
Created my index  
PUT /test  
{  
"mappings": {  
"tweet": {  
"properties": {  
"message": {"type": "text"},  
"tags": {"type": "text"},  
"content": {  
"properties": {  
"name": {"type": "text"},  
"msgbody": {"type": "text"}  
}  
}  
}  
}  
}  
}  
Then added content  
JSON content  
{"index":{"\_index":"tweets", "\_type":"content", "\_id": "2"}}  
{"message":"I've now added a second tweet...", "tags":"elasticsearch wow yahoo", "[contents.name](http://contents.name)":"prog\_list", "contents.msgbody":"programming list"}

d:\Apps\curl\>curl -XPUT localhost:9200/\_bulk --data-binary @tweets.json

Now I will be happy to close this request as I'm slowly getting the hang of what to do.

Cheers

---

<div class="post-metadata">

**Author:** ![guilherme\_maranhao](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guilherme_maranhao/32/101483_2.png) [@guilherme\_maranhao](https://discuss.elastic.co/u/guilherme_maranhao)\
**Post date:** [November 25, 2016, 10:28am UTC](https://discuss.elastic.co/t/how-to-work-with-a-json-array/67042/8 "2016-11-25T10:28:35Z")

</div>

Cool! Happy to know you did it! So, the solution was just replacing "string" to "text"?

---

<div class="post-metadata">

**Author:** ![AussiePete2015](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aussiepete2015/32/13407_2.png) [@AussiePete2015](https://discuss.elastic.co/u/AussiePete2015)\
**Post date:** [November 28, 2016, 9:36pm UTC](https://discuss.elastic.co/t/how-to-work-with-a-json-array/67042/9 "2016-11-28T21:36:50Z")

</div>

Hi Guilherme

Actually it was a bit more than that. I used mappings in before the attribute and yes text seems to have resolved the other issues.  
The link you provided was crucial to this resolution so thanks, greatly appreciate the tip.

Cheers

---

<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 26, 2016, 9:37pm UTC](https://discuss.elastic.co/t/how-to-work-with-a-json-array/67042/10 "2016-12-26T21:37:04Z")

</div>

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