Tutorial/example of embedding?


(bimargulies) #1

I want to hide an elastic search instance entirely within my own
webapp. Googling shows evidence that this is possible, but I'd be
grateful for a straight-up example.


(Shay Banon) #2

http://www.elasticsearch.org/guide/reference/java-api/.
On Wednesday, May 4, 2011 at 3:04 PM, bimargulies wrote:

I want to hide an elastic search instance entirely within my own
webapp. Googling shows evidence that this is possible, but I'd be
grateful for a straight-up example.


(d95sld95) #3

The Java API seems to only deal with the client side. Is there a way to
embedded the elastic search jar-file into a Web Application have its
lifetime managed by Spring Framework for example.

What class is the bootstrap class? org.elasticsearch.bootstrap.Bootstrap?

Any settings necessary for running embedded?

--
View this message in context: http://elasticsearch-users.115913.n3.nabble.com/tutorial-example-of-embedding-tp2898482p2948551.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.


(Shay Banon) #4

Yes, you can simply start a Node using the NodeBuilder without setting it to be a client node.
On Monday, May 16, 2011 at 7:01 PM, d95sld95 wrote:

The Java API seems to only deal with the client side. Is there a way to
embedded the elastic search jar-file into a Web Application have its
lifetime managed by Spring Framework for example.

What class is the bootstrap class? org.elasticsearch.bootstrap.Bootstrap?

Any settings necessary for running embedded?

--
View this message in context: http://elasticsearch-users.115913.n3.nabble.com/tutorial-example-of-embedding-tp2898482p2948551.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.


(James Cook) #5

Here is how I do it:

<!--

-->

<!--


-->

<bean id="elasticSearchConfiguration"

class="org.springframework.beans.factory.config.PropertiesFactoryBean">




${webapp.root}/WEB-INF/config


<bean id="esServer" class="my.elasticsearch.ElasticSearchServer"
      init-method="start" destroy-method="stop">
    <constructor-arg ref="elasticSearchConfiguration"/>
</bean>

and here is a gist for the code to ElasticSearchServer.java:

-- jim

On Tue, May 17, 2011 at 4:37 PM, Shay Banon shay.banon@elasticsearch.comwrote:

Yes, you can simply start a Node using the NodeBuilder without setting it
to be a client node.

On Monday, May 16, 2011 at 7:01 PM, d95sld95 wrote:

The Java API seems to only deal with the client side. Is there a way to
embedded the elastic search jar-file into a Web Application have its
lifetime managed by Spring Framework for example.

What class is the bootstrap class? org.elasticsearch.bootstrap.Bootstrap?

Any settings necessary for running embedded?

--
View this message in context:
http://elasticsearch-users.115913.n3.nabble.com/tutorial-example-of-embedding-tp2898482p2948551.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.


(system) #6