tutorial/example of embedding?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

tutorial/example of embedding?

bimargulies
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.
Reply | Threaded
Open this post in threaded view
|

Re: tutorial/example of embedding?

kimchy
Administrator
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.

Reply | Threaded
Open this post in threaded view
|

Re: tutorial/example of embedding?

d95sld95

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.
Reply | Threaded
Open this post in threaded view
|

Re: tutorial/example of embedding?

kimchy
Administrator
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.

Reply | Threaded
Open this post in threaded view
|

Re: tutorial/example of embedding?

James Cook
Here is how I do it:

    <!-- *************************************************************************************** -->
    <!-- Elastic Search Configuration                                                            -->
    <!-- *************************************************************************************** -->

    <bean id="elasticSearchConfiguration"
          class="org.springframework.beans.factory.config.PropertiesFactoryBean">
        <property name="location" value="classpath:elasticsearch-server.properties"/>
        <property name="localOverride" value="true"/>
        <property name="properties">
            <props>
                <prop key="path.conf">${webapp.root}/WEB-INF/config</prop>
            </props>
        </property>
    </bean>

    <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 <[hidden email]> wrote:
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.