# Using EsStorage for nested data

**URL:** <https://discuss.elastic.co/t/using-esstorage-for-nested-data/25836>\
**Category:** Elasticsearch\
**Tags:** es-hadoop\
**Created:** [July 17, 2015, 9:58pm UTC](https://discuss.elastic.co/t/using-esstorage-for-nested-data/25836 "2015-07-17T21:58:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vijaym123](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vijaym123/32/3590_2.png) [@vijaym123](https://discuss.elastic.co/u/vijaym123)\
**Post date:** [July 17, 2015, 9:58pm UTC](https://discuss.elastic.co/t/using-esstorage-for-nested-data/25836/1 "2015-07-17T21:58:24Z")

</div>

Hello Everyone,

Here is my pig script;  
A = load '/projects/blog' using AvroStorage();  
B =LIMIT A 5;  
STORE B INTO 'blog/user' USING org.elasticsearch.hadoop.pig.EsStorage('es.nodes = [test.myes.com](http://test.myes.com)','es.port = 80');

B's schema :  
B: {name: chararray, id: long, segments: {ARRAY\_ELEM: (message:string, stars: int, date:string)}}

and want to put it in ES with the nested mapping:

> ```
> {
> "mappings": {
> "blogpost": {
> "properties": {
> "name": {
> "type": "string",
> "store": true
> },
> "id": {
> "type": "long",
> "store": true
> },
> "comments": {
> "type": "nested", 
> "properties": {
> "message": { "type": "string" },
> "stars": { "type": "int" },
> "date": { "type": "string" }
> }
> }
> }
> }
> }
> }
> ```

Can you guys please help me with parameters that I need to pass to EsStorage to have nested structure?

Thanks,  
Vijay

---

<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:** [July 6, 2017, 1:27pm UTC](https://discuss.elastic.co/t/using-esstorage-for-nested-data/25836/2 "2017-07-06T13:27:57Z")

</div>

Closed on July 6, 2017, 1:27pm UTC


