# Question about spring-elasticsearch

**URL:** <https://discuss.elastic.co/t/question-about-spring-elasticsearch/11191>\
**Category:** Elasticsearch\
**Created:** [March 18, 2013, 3:30pm UTC](https://discuss.elastic.co/t/question-about-spring-elasticsearch/11191 "2013-03-18T15:30:30Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![yahia](https://avatars.discourse-cdn.com/v4/letter/y/d9b06d/32.png) [@yahia](https://discuss.elastic.co/u/yahia)\
**Post date:** [March 18, 2013, 3:30pm UTC](https://discuss.elastic.co/t/question-about-spring-elasticsearch/11191/1 "2013-03-18T15:30:30Z")

</div>

Hi all

i use spring-elasticsearch, I want to know the documents indexed by this  
factory where they are stored ??

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [March 18, 2013, 3:34pm UTC](https://discuss.elastic.co/t/question-about-spring-elasticsearch/11191/2 "2013-03-18T15:34:54Z")

</div>

It depends:

- do you use the factory to connect to a node (TransportClient or Client from a Client Node)? If so, documents are in your node.
- do you use the factory to start an embedded node? If so, documents are stored on your local node (look for a data dir) from where you start your java code.

You can set it up using [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/setup/dir-layout.html)

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 18 mars 2013 à 16:30, Ammar Yahia [yahia.ammar.info@gmail.com](mailto:yahia.ammar.info@gmail.com) a écrit :

> Hi all
> 
> i use spring-elasticsearch, I want to know the documents indexed by this factory where they are stored ??
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![yahia](https://avatars.discourse-cdn.com/v4/letter/y/d9b06d/32.png) [@yahia](https://discuss.elastic.co/u/yahia)\
**Post date:** [March 18, 2013, 4:25pm UTC](https://discuss.elastic.co/t/question-about-spring-elasticsearch/11191/3 "2013-03-18T16:25:04Z")

</div>

I use a separate elasticsearch instance (we'll call inst1), which is empty  
(I delete the data folder), and in my web application I am using the  
factory spring-elasticsearch, i use this declaration in

application context \<elasticsearch:node id="esNode" /\>  
\<elasticsearch:client node="esNode" id="esClient" /\>

elasticsearch instance in inst1 is up, when I start my application I  
notice that there are indexes that are added in my inst1, so they are sent  
by the instance elasticsearch who is started by the factory  
spring-elasticsearch; and in my web-application i don't find data folder  
that should contains the different informations sent to inst1.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![yahia](https://avatars.discourse-cdn.com/v4/letter/y/d9b06d/32.png) [@yahia](https://discuss.elastic.co/u/yahia)\
**Post date:** [March 18, 2013, 4:35pm UTC](https://discuss.elastic.co/t/question-about-spring-elasticsearch/11191/4 "2013-03-18T16:35:58Z")

</div>

so different information is stored in the node launched by the factory  
spring-elasticsearch ?? how can I delete these different data?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [March 18, 2013, 4:36pm UTC](https://discuss.elastic.co/t/question-about-spring-elasticsearch/11191/5 "2013-03-18T16:36:17Z")

</div>

So you are using a Node which is client only?  
By default, Nodes are regular ones (means that they hold data).

You can log the path using debug level:  
[https://github.com/dadoonet/spring-elasticsearch/blob/master/src/main/java/fr/pilato/spring/elasticsearch/ElasticsearchNodeFactoryBean.java#L69](https://github.com/dadoonet/spring-elasticsearch/blob/master/src/main/java/fr/pilato/spring/elasticsearch/ElasticsearchNodeFactoryBean.java#L69)

If you don't find files data, that probably means that you have somewhere an es.properties file or an elasticsearch.yml file in your classpath.  
An example of es.properties can be found here: [https://github.com/dadoonet/spring-elasticsearch/blob/master/src/test/resources/es.properties](https://github.com/dadoonet/spring-elasticsearch/blob/master/src/test/resources/es.properties)

That said, are you sure that you want to hold data in your web app and not only on ES nodes (inst1)?

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 18 mars 2013 à 17:25, Ammar Yahia [yahia.ammar.info@gmail.com](mailto:yahia.ammar.info@gmail.com) a écrit :

> I use a separate elasticsearch instance (we'll call inst1), which is empty (I delete the data folder), and in my web application I am using the factory spring-elasticsearch, i use this declaration in
> 
> application context \<elasticsearch:node id="esNode" /\>  
> \<elasticsearch:client node="esNode" id="esClient" /\>
> 
> elasticsearch instance in inst1 is up, when I start my application I notice that there are indexes that are added in my inst1, so they are sent by the instance elasticsearch who is started by the factory spring-elasticsearch; and in my web-application i don't find data folder that should contains the different informations sent to inst1.
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [March 18, 2013, 4:46pm UTC](https://discuss.elastic.co/t/question-about-spring-elasticsearch/11191/6 "2013-03-18T16:46:08Z")

</div>

I can't see your concern.

What do you want to achieve here?

Hold data in inst1 only?  
Hold data in inst1 AND webapp?

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 18 mars 2013 à 17:35, Ammar Yahia [yahia.ammar.info@gmail.com](mailto:yahia.ammar.info@gmail.com) a écrit :

> so different information is stored in the node launched by the factory spring-elasticsearch ?? how can I delete these different data?
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![yahia](https://avatars.discourse-cdn.com/v4/letter/y/d9b06d/32.png) [@yahia](https://discuss.elastic.co/u/yahia)\
**Post date:** [March 18, 2013, 5:02pm UTC](https://discuss.elastic.co/t/question-about-spring-elasticsearch/11191/7 "2013-03-18T17:02:37Z")

</div>

I want to delete all the data that exists in elasticsearch, I delete the  
data folder in inst1, but when I run my web application data that have been  
deleted will be loaded back into my ins1

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![yahia](https://avatars.discourse-cdn.com/v4/letter/y/d9b06d/32.png) [@yahia](https://discuss.elastic.co/u/yahia)\
**Post date:** [March 18, 2013, 5:06pm UTC](https://discuss.elastic.co/t/question-about-spring-elasticsearch/11191/8 "2013-03-18T17:06:14Z")

</div>

I do not declare a file as es.properties, I just edit the  
application-context by \<elasticsearch:node id="esNode" /\>

```
                      <elasticsearch:client node="esNode" id="esClient" 

```

/\>

and inin my java code I declare the client as follows @Autowired

private Client esClient;

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![yahia](https://avatars.discourse-cdn.com/v4/letter/y/d9b06d/32.png) [@yahia](https://discuss.elastic.co/u/yahia)\
**Post date:** [March 18, 2013, 5:07pm UTC](https://discuss.elastic.co/t/question-about-spring-elasticsearch/11191/9 "2013-03-18T17:07:05Z")

</div>

esClient.prepareSearch().....

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [March 18, 2013, 6:16pm UTC](https://discuss.elastic.co/t/question-about-spring-elasticsearch/11191/10 "2013-03-18T18:16:54Z")

</div>

You want to clean your cluster each time you restart or only once?

curl -XDELETE [http://localhost:9200](http://localhost:9200) will clean everything on your cluster.

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 18 mars 2013 à 18:06, Ammar Yahia [yahia.ammar.info@gmail.com](mailto:yahia.ammar.info@gmail.com) a écrit :

> I do not declare a file as es.properties, I just edit the application-context by \<elasticsearch:node id="esNode" /\>  
> \<elasticsearch:client node="esNode" id="esClient" /\>
> 
> and inin my java code I declare the client as follows @Autowired  
> private Client esClient;
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![yahia](https://avatars.discourse-cdn.com/v4/letter/y/d9b06d/32.png) [@yahia](https://discuss.elastic.co/u/yahia)\
**Post date:** [March 19, 2013, 9:00am UTC](https://discuss.elastic.co/t/question-about-spring-elasticsearch/11191/11 "2013-03-19T09:00:03Z")

</div>

thx david, this is what I want , deleting all data from my web-application  
and inst1,

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:45am UTC](https://discuss.elastic.co/t/question-about-spring-elasticsearch/11191/12 "2017-07-06T02:45:52Z")

</div>


