# Embedded ElasticSearch On JAVA API Index Location

**URL:** <https://discuss.elastic.co/t/embedded-elasticsearch-on-java-api-index-location/7061>\
**Category:** Elasticsearch\
**Created:** [March 19, 2012, 5:38pm UTC](https://discuss.elastic.co/t/embedded-elasticsearch-on-java-api-index-location/7061 "2012-03-19T17:38:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![samCougars](https://avatars.discourse-cdn.com/v4/letter/s/71e660/32.png) [@samCougars](https://discuss.elastic.co/u/samCougars)\
**Post date:** [March 19, 2012, 5:38pm UTC](https://discuss.elastic.co/t/embedded-elasticsearch-on-java-api-index-location/7061/1 "2012-03-19T17:38:29Z")

</div>

This is how I'm doing in java api:  
ImmutableSettings.Builder settings = ImmutableSettings.settingsBuilder();  
settings.put("path.home",System.getProperty("user.home")+"/elasticSearch");  
settings.put("number\_of\_shards",1);  
settings.put("number\_of\_replicas",0);  
Node node = NodeBuilder.nodeBuilder().settings(settings).clusterName("firstCluster").node();

Client client = node.client();  
client.admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet();

client.prepareIndex("searchdata", "exhibitor", "9999").setSource("My data information").execute().actionGet();

When I use this to create node and index, it creates the folder "elasticSearch" under my home directory. But even after I remove "elasticSearch", it still does search. So I have no clue where it is grabbing the indexed data after I have completely deleted "elasticSearch". Any suggestions?  
Thanks

---

<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, 3:35am UTC](https://discuss.elastic.co/t/embedded-elasticsearch-on-java-api-index-location/7061/2 "2017-07-06T03:35:33Z")

</div>


