I'm a new user who's integrated elastic search into a grails application.
Now, I'd like to write some tests. To test the service, I was looking for
a way to synchronously rebuild my indices, rather than send an asynchronous
request(that way I can get consistent behavior).
Does elastic search provide anything like this? If so, what does this call
on a elastic search node or client look like?
In order to test elasticsearch in this scenario, I would suggest starting
elasticsearch in local mode (local to the JVM using the node builder) within
your test. I am not sure what you mean regarding the async index requests,
do you mean that you call index but don't call "get" on the result? Or is it
the near real time aspect of elasticsearch? If its the latter, you can call
the refresh API in your tests to see the latest changes done in your tests.
-shay.banon
On Thu, Jun 17, 2010 at 7:27 PM, Michael Kohout mwkohout@gmail.com wrote:
Hi all;
I'm a new user who's integrated Elasticsearch into a grails application.
Now, I'd like to write some tests. To test the service, I was looking for
a way to synchronously rebuild my indices, rather than send an asynchronous
request(that way I can get consistent behavior).
Does Elasticsearch provide anything like this? If so, what does this call
on a Elasticsearch node or client look like?
Yup, I've already got it running inside the webapp jvm. I think the problem
is the "near real time" aspect of Elasticsearch but I'm just guessing.
What I'm thinking I've got to do, is replace this():
def builder =
node.client.admin.indices.indicesAdminClient.prepareRefresh("project")
node.client.admin.indices.indicesAdminClient.refresh(builder.request)
which exists inside a method that will index a passed in domain object(the
method is included at the end of my message) with...something that will work
in a synchronous manner.
What do you think? Does my conclusion make sense?
Mike
def index(Project p) {
def indexR = node.client.index {
index "project"
type "project"
id p.id
source {
name = p.name
username = p.user.username
tags = p.tags
In order to test elasticsearch in this scenario, I would suggest starting
elasticsearch in local mode (local to the JVM using the node builder) within
your test. I am not sure what you mean regarding the async index requests,
do you mean that you call index but don't call "get" on the result? Or is it
the near real time aspect of elasticsearch? If its the latter, you can call
the refresh API in your tests to see the latest changes done in your tests.
-shay.banon
On Thu, Jun 17, 2010 at 7:27 PM, Michael Kohout mwkohout@gmail.comwrote:
Hi all;
I'm a new user who's integrated Elasticsearch into a grails application.
Now, I'd like to write some tests. To test the service, I was looking for
a way to synchronously rebuild my indices, rather than send an asynchronous
request(that way I can get consistent behavior).
Does Elasticsearch provide anything like this? If so, what does this
call on a Elasticsearch node or client look like?
Yes, it make sense, but only do it when testings, refreshing on every index
request in production is very expensive. By the way, I plan to enable the
"prepare" API as groovy extended APIs.
-shay.banon
On Fri, Jun 18, 2010 at 12:01 AM, Michael Kohout mwkohout@gmail.com wrote:
Yup, I've already got it running inside the webapp jvm. I think the
problem is the "near real time" aspect of Elasticsearch but I'm just
guessing.
What I'm thinking I've got to do, is replace this():
def builder =
node.client.admin.indices.indicesAdminClient.prepareRefresh("project")
node.client.admin.indices.indicesAdminClient.refresh(builder.request)
which exists inside a method that will index a passed in domain object(the
method is included at the end of my message) with...something that will work
in a synchronous manner.
What do you think? Does my conclusion make sense?
Mike
def index(Project p) {
def indexR = node.client.index {
index "project"
type "project"
id p.id
source {
name = p.name
username = p.user.username
tags = p.tags
In order to test elasticsearch in this scenario, I would suggest starting
elasticsearch in local mode (local to the JVM using the node builder) within
your test. I am not sure what you mean regarding the async index requests,
do you mean that you call index but don't call "get" on the result? Or is it
the near real time aspect of elasticsearch? If its the latter, you can call
the refresh API in your tests to see the latest changes done in your tests.
-shay.banon
On Thu, Jun 17, 2010 at 7:27 PM, Michael Kohout mwkohout@gmail.comwrote:
Hi all;
I'm a new user who's integrated Elasticsearch into a grails application.
Now, I'd like to write some tests. To test the service, I was looking for
a way to synchronously rebuild my indices, rather than send an asynchronous
request(that way I can get consistent behavior).
Does Elasticsearch provide anything like this? If so, what does this
call on a Elasticsearch node or client look like?
Fantastic! Thanks for your help. I feel a bit foolish asking, but could
you point me towards the url documenting the java or rest api calls that
I've got to do to get a synchronous index refresh?
Yes, it make sense, but only do it when testings, refreshing on every index
request in production is very expensive. By the way, I plan to enable the
"prepare" API as groovy extended APIs.
-shay.banon
On Fri, Jun 18, 2010 at 12:01 AM, Michael Kohout mwkohout@gmail.comwrote:
Yup, I've already got it running inside the webapp jvm. I think the
problem is the "near real time" aspect of Elasticsearch but I'm just
guessing.
What I'm thinking I've got to do, is replace this():
def builder =
node.client.admin.indices.indicesAdminClient.prepareRefresh("project")
node.client.admin.indices.indicesAdminClient.refresh(builder.request)
which exists inside a method that will index a passed in domain object(the
method is included at the end of my message) with...something that will work
in a synchronous manner.
What do you think? Does my conclusion make sense?
Mike
def index(Project p) {
def indexR = node.client.index {
index "project"
type "project"
id p.id
source {
name = p.name
username = p.user.username
tags = p.tags
In order to test elasticsearch in this scenario, I would suggest starting
elasticsearch in local mode (local to the JVM using the node builder) within
your test. I am not sure what you mean regarding the async index requests,
do you mean that you call index but don't call "get" on the result? Or is it
the near real time aspect of elasticsearch? If its the latter, you can call
the refresh API in your tests to see the latest changes done in your tests.
-shay.banon
On Thu, Jun 17, 2010 at 7:27 PM, Michael Kohout mwkohout@gmail.comwrote:
Hi all;
I'm a new user who's integrated Elasticsearch into a grails
application. Now, I'd like to write some tests. To test the service, I was
looking for a way to synchronously rebuild my indices, rather than send an
asynchronous request(that way I can get consistent behavior).
Does Elasticsearch provide anything like this? If so, what does this
call on a Elasticsearch node or client look like?
On Fri, Jun 18, 2010 at 7:43 PM, Michael Kohout mwkohout@gmail.com wrote:
Fantastic! Thanks for your help. I feel a bit foolish asking, but could
you point me towards the url documenting the java or rest api calls that
I've got to do to get a synchronous index refresh?
Yes, it make sense, but only do it when testings, refreshing on every
index request in production is very expensive. By the way, I plan to enable
the "prepare" API as groovy extended APIs.
-shay.banon
On Fri, Jun 18, 2010 at 12:01 AM, Michael Kohout mwkohout@gmail.comwrote:
Yup, I've already got it running inside the webapp jvm. I think the
problem is the "near real time" aspect of Elasticsearch but I'm just
guessing.
What I'm thinking I've got to do, is replace this():
def builder =
node.client.admin.indices.indicesAdminClient.prepareRefresh("project")
node.client.admin.indices.indicesAdminClient.refresh(builder.request)
which exists inside a method that will index a passed in domain
object(the method is included at the end of my message) with...something
that will work in a synchronous manner.
What do you think? Does my conclusion make sense?
Mike
def index(Project p) {
def indexR = node.client.index {
index "project"
type "project"
id p.id
source {
name = p.name
username = p.user.username
tags = p.tags
In order to test elasticsearch in this scenario, I would suggest
starting elasticsearch in local mode (local to the JVM using the node
builder) within your test. I am not sure what you mean regarding the async
index requests, do you mean that you call index but don't call "get" on the
result? Or is it the near real time aspect of elasticsearch? If its the
latter, you can call the refresh API in your tests to see the latest changes
done in your tests.
-shay.banon
On Thu, Jun 17, 2010 at 7:27 PM, Michael Kohout mwkohout@gmail.comwrote:
Hi all;
I'm a new user who's integrated Elasticsearch into a grails
application. Now, I'd like to write some tests. To test the service, I was
looking for a way to synchronously rebuild my indices, rather than send an
asynchronous request(that way I can get consistent behavior).
Does Elasticsearch provide anything like this? If so, what does this
call on a Elasticsearch node or client look like?
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.