Cancelling Search Request & Search Query Timeout

Hi Team,

We use the following statements (only partial) to get the search response -

SearchRequestBuilder builder = null;
SearchResponse res= builder .execute().actionGet();

Can we cancel the above search request!

Also we use the following statement to set the query timeout value in the SearchRequestBuilder instance -

SearchRequestBuilder builder= TransportClient.prepareSearch().setTimeout(...);

Here TransportClient has already been initialized. We set the timeout to 1 minutes. It happen sometimes that we don't get the response in 1 minutes and even query is not timed out, that is query is executing on ES server. We don't get any exception either. Can someone please explain the scenarios when query will be timed out or not timed out! Do we need to set some other way.

We have a GWT web application and when user don't get response in a certain time he started to get impatient and hit the submit button again. For this we have decided to disable the submit button and enable it only when we get back the response. But in cases where query doesn't return any response or throw exceptions, in certain time user waits longer & longer.

Please suggest.

Thanks.

The search request cannot be cancelled. From my understanding of the code,
the timeout value is used only as a parameter to the TimeLimitingCollector
wrapper around elasticsearch's facet collectors. There have been other
discussion regarding long queries not respecting the timeout value.

--
Ivan

On Tue, Apr 16, 2013 at 11:35 PM, ElasticUsers kranti_123@rediffmail.comwrote:

Hi Team,

We use the following statements (only partial) to get the search response -

SearchRequestBuilder builder = null;
SearchResponse res= builder .execute().actionGet();

Can we cancel the above search request!

Also we use the following statement to set the query timeout value in the
SearchRequestBuilder instance -

SearchRequestBuilder builder=

TransportClient.prepareSearch().setTimeout(...);

Here TransportClient has already been initialized. We set the timeout to 1
minutes. It happen sometimes that we don't get the response in 1 minutes
and
even query is not timed out, that is query is executing on ES server. We
don't get any exception either. Can someone please explain the scenarios
when query will be timed out or not timed out! Do we need to set some other
way.

We have a GWT web application and when user don't get response in a certain
time he started to get impatient and hit the submit button again. For this
we have decided to disable the submit button and enable it only when we get
back the response. But in cases where query doesn't return any response or
throw exceptions, in certain time user waits longer & longer.

Please suggest.

Thanks.

--
View this message in context:
http://elasticsearch-users.115913.n3.nabble.com/Cancelling-Search-Request-Search-Query-Timeout-tp4033510.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.

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

Note that actionGet() can be replaced by a time-limited version, for example

SearchResponse response = builder.execute().actionGet()

-->

SearchResponse response = builder.execute().actionGet(1, TimeUnit.MINUTES)

As said, this does not stop a running query execution, but it returns to
the requester if the execution times out with an
org.elasticsearch.ElasticSearchInterruptedException

Jörg

Am 17.04.13 19:37, schrieb Ivan Brusic:

The search request cannot be cancelled. From my understanding of the
code, the timeout value is used only as a parameter to
the TimeLimitingCollector wrapper around elasticsearch's facet
collectors. There have been other discussion regarding long queries
not respecting the timeout value.

--
Ivan

On Tue, Apr 16, 2013 at 11:35 PM, ElasticUsers
<kranti_123@rediffmail.com mailto:kranti_123@rediffmail.com> wrote:

Hi Team,

We use the following statements (only partial) to get the search
response -

    SearchRequestBuilder builder = null;
    SearchResponse res= builder .execute().actionGet();

Can we cancel the above search request!

Also we use the following statement to set the query timeout value
in the
SearchRequestBuilder instance -

    SearchRequestBuilder builder=
TransportClient.prepareSearch().setTimeout(...);

Here TransportClient has already been initialized. We set the
timeout to 1
minutes. It happen sometimes that we don't get the response in 1
minutes and
even query is not timed out, that is query is executing on ES
server. We
don't get any exception either. Can someone please explain the
scenarios
when query will be timed out or not timed out! Do we need to set
some other
way.

We have a GWT web application and when user don't get response in
a certain
time he started to get impatient and hit the submit button again.
For this
we have decided to disable the submit button and enable it only
when we get
back the response. But in cases where query doesn't return any
response or
throw exceptions, in certain time user waits longer & longer.

Please suggest.

Thanks.





--
View this message in context:
http://elasticsearch-users.115913.n3.nabble.com/Cancelling-Search-Request-Search-Query-Timeout-tp4033510.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.

--
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
<mailto:elasticsearch%2Bunsubscribe@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.