# Elastic search document indexing

**URL:** <https://discuss.elastic.co/t/elastic-search-document-indexing/31334>\
**Category:** Elasticsearch\
**Created:** [September 29, 2015, 12:28pm UTC](https://discuss.elastic.co/t/elastic-search-document-indexing/31334 "2015-09-29T12:28:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pshahukhal](https://avatars.discourse-cdn.com/v4/letter/p/54ee81/32.png) [@pshahukhal](https://discuss.elastic.co/u/pshahukhal)\
**Post date:** [September 29, 2015, 12:28pm UTC](https://discuss.elastic.co/t/elastic-search-document-indexing/31334/1 "2015-09-29T12:28:56Z")

</div>

Hello  
I am new to Elastic search .I have been trying to post a json file containing number of documents using '\_bulk' endpoint .The command I use is  
curl -XPOST "[http://localhost:9200/[index]/[type]/\_bulk](http://localhost:9200/%5Bindex%5D/%5Btype%5D/_bulk)" --data-binary @json  
My json file looks like this

{"index":{}}  
{"name": "user1","title": "title1","address": "address1" }

```
 I have few questions related to this 

```

1.Do i really need to include '{"index":{}}' above every json data ?Is there a work around to post the json file in bulk in formats other than this without including '{"index":{}}'.  
2. I want to make the documents unique based on combination of name and title so that when I post the json data with same name and title but different address it should update the document instead of creating a new one .How can i achieve this  
3. LIke post.jar in SOLR, are there any jars for elastic search to index data ?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 29, 2015, 12:34pm UTC](https://discuss.elastic.co/t/elastic-search-document-indexing/31334/2 "2015-09-29T12:34:21Z")

</div>

Take a look at [https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html) for some more information around using bulk, it should help.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [September 29, 2015, 12:42pm UTC](https://discuss.elastic.co/t/elastic-search-document-indexing/31334/3 "2015-09-29T12:42:12Z")

</div>

1. Yes you have to.
2. Use an `_id` composed of name and title and may be encode it with BASE64
3. Use elasticsearch java client

My cents

---

<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 5, 2017, 11:47pm UTC](https://discuss.elastic.co/t/elastic-search-document-indexing/31334/4 "2017-07-05T23:47:35Z")

</div>


