Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ElasticSearch, Nest and timeout for long queries

I am using ElasticSearch with Nest (0.9.16) and have some queries which take longer than 60 seconds. When that happens, I receive the following error:

The request was aborted: The request was canceled.

While I am concerned that the query is taking such a long time, for this question, I am just interested if there is a way to increase the timeout. I have not been able to find a way to increase the timeout.

Note, I do see a couple of places where I can set a timeout, but these are not the right places:

var setting = new ConnectionSettings(new Uri(searchUrl)).SetTimeout(200000);

or

searchdescriptor.Timeout("120000");

The first one sets the connection timeout and the second one sets the ElasticSearch timeout, both of which are not helpful here.

Thanks, Eric

like image 567
Eric Avatar asked Jul 25 '14 16:07

Eric


1 Answers

Actually, much to my chagrin, the ConnectionSettings().SetTimeout() does in fact increase the request timeout and solve my problem. I am not sure why I missed this initially.

like image 105
Eric Avatar answered Oct 08 '22 05:10

Eric