I am new to ES and try to build my head around it
I think I am going to use ES for my project, so I am going
to do some unittests for me.
ES looks on one hand easy to use but on the other hand
I do not know where to get startet.
Since I do not need now to have a seperate search server
I would like to use ES from within my Scala app.
I have placed a elasticsearch.json file in my "resources" dir,
so it will be on the classpath.
Is it sufficient to just get a
NodeBuilder.nodeBuilder().node().client()
and work with it? Or is there another step that I am missing?
Here is an info http://www.elasticsearch.org/guide/reference/java-api/client.html
that for unittest I need to set a node as "local" so that it can
connect to a local node.
That confused me a bit.
you would want to keep the Node returned around as well (and keep it at the application score). And then, when the application stops / closes, call close on it. Other than that, looks good.
On Friday, May 20, 2011 at 1:32 PM, greekscala wrote:
Hello ES community,
I am new to ES and try to build my head around it
I think I am going to use ES for my project, so I am going
to do some unittests for me.
ES looks on one hand easy to use but on the other hand
I do not know where to get startet.
Since I do not need now to have a seperate search server
I would like to use ES from within my Scala app.
I have placed a elasticsearch.json file in my "resources" dir,
so it will be on the classpath.
Is it sufficient to just get a
NodeBuilder.nodeBuilder().node().client()
and work with it? Or is there another step that I am missing?
Here is an info Elasticsearch Platform — Find real-time answers at scale | Elastic
that for unittest I need to set a node as "local" so that it can
connect to a local node.
That confused me a bit.
you would want to keep the Node returned around as well (and keep it at the application score). And then, when the application stops / closes, call close on it. Other than that, looks good.On Friday, May 20, 2011 at 1:32 PM, greekscala wrote:
Hello ES community,
I am new to ES and try to build my head around it
I think I am going to use ES for my project, so I am going
to do some unittests for me.
ES looks on one hand easy to use but on the other hand
I do not know where to get startet.
Since I do not need now to have a seperate search server
I would like to use ES from within my Scala app.
I have placed a elasticsearch.json file in my "resources" dir,
so it will be on the classpath.
Is it sufficient to just get a
NodeBuilder.nodeBuilder().node().client()
and work with it? Or is there another step that I am missing?
Here is an infohttp://www.elasticsearch.org/guide/reference/java-api/client.html
that for unittest I need to set a node as "local" so that it can
connect to a local node.
That confused me a bit.
you would want to keep the Node returned around as well (and keep it at the application score). And then, when the application stops / closes, call close on it. Other than that, looks good.On Friday, May 20, 2011 at 1:32 PM, greekscala wrote:
Hello ES community,
I am new to ES and try to build my head around it
I think I am going to use ES for my project, so I am going
to do some unittests for me.
ES looks on one hand easy to use but on the other hand
I do not know where to get startet.
Since I do not need now to have a seperate search server
I would like to use ES from within my Scala app.
I have placed a elasticsearch.json file in my "resources" dir,
so it will be on the classpath.
Is it sufficient to just get a
NodeBuilder.nodeBuilder().node().client()
and work with it? Or is there another step that I am missing?
Here is an infohttp://www.elasticsearch.org/guide/reference/java-api/client.html
that for unittest I need to set a node as "local" so that it can
connect to a local node.
That confused me a bit.
I found that having ES run as a service has many benefits. Scaling is
one since clustrering support is kind of built-in. And having many
different indexes running on the same server etc.
Running tests and queries is also easier on a standalons server.
But for a small application an embedded solution might work.
When it comes to coding the Java API I found the simplest solution was
to download the source and look at the plethora of unit tests that are
in there. They are the true bluerprint of what the API can do. The docs
where (at the time I started coding) a bit lacking...
thank you for your comment. I think that I will need an ES-Server
in the future. But for now I think that I will try to use ES as
embedded.
The idea with the unit tests is a good one. Will clone the repository
and take a look.
Just to be complete. The link above to the spring solution helped.
I just created a bean with postConstruct and preDestroy annotations: @Service
class SearchServiceESImpl extends SearchService {
I found that having ES run as a service has many benefits. Scaling is
one since clustrering support is kind of built-in. And having many
different indexes running on the same server etc.
Running tests and queries is also easier on a standalons server.
But for a small application an embedded solution might work.
When it comes to coding the Java API I found the simplest solution was
to download the source and look at the plethora of unit tests that are
in there. They are the true bluerprint of what the API can do. The docs
where (at the time I started coding) a bit lacking...
Yes, that Spring solution is what I use myself. In a simple servlet
there are the standard init and destroy methods as well that can be
used in similar manner.
/Kristian
greekscala skrev 2011-05-31 23:29:
Hello Kristian,
thank you for your comment. I think that I will need an ES-Server
in the future. But for now I think that I will try to use ES as
embedded.
The idea with the unit tests is a good one. Will clone the repository
and take a look.
Just to be complete. The link above to the spring solution helped.
I just created a bean with postConstruct and preDestroy annotations: @Service
class SearchServiceESImpl extends SearchService {
On 24 Mai, 09:10, Kristian Jörgk...@devo.se wrote:
greekscala skrev 2011-05-20 15:56:
Just found this: http://groups.google.com/a/elasticsearch.com/group/users/browse_threa...
Think will take the Spring approach, too.
best reagards
I found that having ES run as a service has many benefits. Scaling is
one since clustrering support is kind of built-in. And having many
different indexes running on the same server etc.
Running tests and queries is also easier on a standalons server.
But for a small application an embedded solution might work.
When it comes to coding the Java API I found the simplest solution was
to download the source and look at the plethora of unit tests that are
in there. They are the true bluerprint of what the API can do. The docs
where (at the time I started coding) a bit lacking...
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.