# Insert List of nested datatype using Java API

**URL:** <https://discuss.elastic.co/t/insert-list-of-nested-datatype-using-java-api/99493>\
**Category:** Elasticsearch\
**Created:** [September 5, 2017, 9:58pm UTC](https://discuss.elastic.co/t/insert-list-of-nested-datatype-using-java-api/99493 "2017-09-05T21:58:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pritom\_Ahmed](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pritom_ahmed/32/20783_2.png) [@Pritom\_Ahmed](https://discuss.elastic.co/u/Pritom_Ahmed)\
**Post date:** [September 5, 2017, 9:58pm UTC](https://discuss.elastic.co/t/insert-list-of-nested-datatype-using-java-api/99493/1 "2017-09-05T21:58:51Z")

</div>

Hi,

I have an ArrayList of objects. Say the objects are of the following format

```
public class S 
{
    String ID;
    Date startTime;
    Long duration;
    List<Tag> tags;
    Process process;
}

```

Here, Tag and Process are POJOs.

I want to

1. Index the Java objects in elasticsearch using the Java API
2. Make queries in the stored index (in the nested objects as well i.e., in Tag, Process)

I am using Flink-elasticsearch connector and IndexRequest class to insert the index.

How can I do it ?

---

<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 3, 2017, 9:58pm UTC](https://discuss.elastic.co/t/insert-list-of-nested-datatype-using-java-api/99493/2 "2017-10-03T21:58:54Z")

</div>

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