Status of an indexResponse in JAVA API

Hi all,

I am using the java api for elasticsearch and was unable to find how to
check the status of my index response. If I create a percolator using the
following query

client.prepareIndex("_percolator", indexName, percolatorName)
.setSource(<some_query>))
.setRefresh(true).execute().actionGet()

I get an index response. However I was unable to find a variable/method in
the same class returning the status of the operation, ie whether it was
successful or failed. I do get some data like id, version. Does a failure
not return id, version fields etc ??

Any help would be greatly appreciated.

Manoj Mohan

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Hey,

if the index response is returned (and therefore no exception has been
thrown), the index operation was successful.

--Alex

On Thu, Jul 4, 2013 at 3:30 PM, Manoj Mohan manoj@intelligrape.com wrote:

Hi all,

I am using the java api for elasticsearch and was unable to find how to
check the status of my index response. If I create a percolator using the
following query

client.prepareIndex("_percolator", indexName, percolatorName)
.setSource(<some_query>))
.setRefresh(true).execute().actionGet()

I get an index response. However I was unable to find a variable/method in
the same class returning the status of the operation, ie whether it was
successful or failed. I do get some data like id, version. Does a failure
not return id, version fields etc ??

Any help would be greatly appreciated.

Manoj Mohan

--
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.
For more options, visit 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.
For more options, visit https://groups.google.com/groups/opt_out.

Hmm.. thanks .. From the name it seemed it would give me a response
regardless of a success or a failure ....

On Thursday, July 4, 2013 7:12:38 PM UTC+5:30, Alexander Reelsen wrote:

Hey,

if the index response is returned (and therefore no exception has been
thrown), the index operation was successful.

--Alex

On Thu, Jul 4, 2013 at 3:30 PM, Manoj Mohan <ma...@intelligrape.com<javascript:>

wrote:

Hi all,

I am using the java api for elasticsearch and was unable to find how to
check the status of my index response. If I create a percolator using the
following query

client.prepareIndex("_percolator", indexName, percolatorName)
.setSource(<some_query>))
.setRefresh(true).execute().actionGet()

I get an index response. However I was unable to find a variable/method
in the same class returning the status of the operation, ie whether it was
successful or failed. I do get some data like id, version. Does a failure
not return id, version fields etc ??

Any help would be greatly appreciated.

Manoj Mohan

--
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 elasticsearc...@googlegroups.com <javascript:>.
For more options, visit 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.
For more options, visit https://groups.google.com/groups/opt_out.

Would the same be true for a SearchResponse? I am asking that because I see
a status method there that gives me a rest status.

Regards
Manoj Mohan
Intelligrape Software

On Thu, Jul 4, 2013 at 7:45 PM, Manoj Mohan manoj@intelligrape.com wrote:

Hmm.. thanks .. From the name it seemed it would give me a response
regardless of a success or a failure ....

On Thursday, July 4, 2013 7:12:38 PM UTC+5:30, Alexander Reelsen wrote:

Hey,

if the index response is returned (and therefore no exception has been
thrown), the index operation was successful.

--Alex

On Thu, Jul 4, 2013 at 3:30 PM, Manoj Mohan ma...@intelligrape.comwrote:

Hi all,

I am using the java api for elasticsearch and was unable to find how to
check the status of my index response. If I create a percolator using the
following query

client.prepareIndex("_**percolator", indexName, percolatorName)
.setSource(<some_query>))
.setRefresh(true).execute().**actionGet()

I get an index response. However I was unable to find a variable/method
in the same class returning the status of the operation, ie whether it was
successful or failed. I do get some data like id, version. Does a failure
not return id, version fields etc ??

Any help would be greatly appreciated.

Manoj Mohan

--
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 elasticsearc...@**googlegroups.com.

For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
.

--
You received this message because you are subscribed to a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/EpzWY3Rq7WM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
For more options, visit 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.
For more options, visit https://groups.google.com/groups/opt_out.

Hey,

a search response is a bit different than a IndexResponse. A index response
simply returns that it has worked, but a SearchResponse can have more than
one status. For example individual shards can fail, but this still is a
valid search response (but yields a different HTTP response code for
example).

Hope this helps, if you need further information, just ask.

--Alex

On Thu, Jul 4, 2013 at 4:20 PM, Manoj Mohan manoj@intelligrape.com wrote:

Would the same be true for a SearchResponse? I am asking that because I
see a status method there that gives me a rest status.

Regards
Manoj Mohan
Intelligrape Software

On Thu, Jul 4, 2013 at 7:45 PM, Manoj Mohan manoj@intelligrape.comwrote:

Hmm.. thanks .. From the name it seemed it would give me a response
regardless of a success or a failure ....

On Thursday, July 4, 2013 7:12:38 PM UTC+5:30, Alexander Reelsen wrote:

Hey,

if the index response is returned (and therefore no exception has been
thrown), the index operation was successful.

--Alex

On Thu, Jul 4, 2013 at 3:30 PM, Manoj Mohan ma...@intelligrape.comwrote:

Hi all,

I am using the java api for elasticsearch and was unable to find how to
check the status of my index response. If I create a percolator using the
following query

client.prepareIndex("_**percolator", indexName, percolatorName)
.setSource(<some_query>))
.setRefresh(true).execute().**actionGet()

I get an index response. However I was unable to find a variable/method
in the same class returning the status of the operation, ie whether it was
successful or failed. I do get some data like id, version. Does a failure
not return id, version fields etc ??

Any help would be greatly appreciated.

Manoj Mohan

--
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 elasticsearc...@**googlegroups.com.

For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
.

--
You received this message because you are subscribed to a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/EpzWY3Rq7WM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.

For more options, visit 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.
For more options, visit 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.
For more options, visit https://groups.google.com/groups/opt_out.

The question is what you want to see to succeed or fail.

In the index request, you can specify a write consistency level (one,
quorum, all), and a replication type (sync, async). Normally you see an
async index response after the index request has been dispatched to the
participating nodes and a quorum of nodes responded. This is before the
document persists across all participating nodes. But you can change the
setting in the write consistency level.

Jörg

Am 04.07.13 16:15, schrieb Manoj Mohan:

Hmm.. thanks .. From the name it seemed it would give me a response
regardless of a success or a failure ....

--
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.
For more options, visit https://groups.google.com/groups/opt_out.