Hi, I'm trying to query elasticsearch from node.js and from time to time I get error
[Error: read ECONNRESET] code: 'ECONNRESET', errno: 'ECONNRESET', syscall: 'read'.
The queries goes one after other, quite quickly, one query takes maybe 30ms to resolve.
Typical query is this one:
POST http://localhost:10200/cloudlog/raw/_search HTTP/1.1
host: localhost:10200
accept: application/json
content-type: application/json
content-length: 109
Connection: close
{"query":{"bool":{"must":[{"match":{"AzId":0}},{"match":{"BatchId":947024}}]}},"sort":["Date"],"size":100000}
What changes is the BatchId.
Response
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Content-Length: 16721
{"took":23,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":18,"max_score":null,"hits":[{"_index":"cloudlog","_type":"raw","_id":"AU29j3XLLGqdlAzQW63j","_score":null,"_source":{"AzId":0,"BatchId":947024,"CompanyId":926101,"CompanyName":"ile","Customer":"","Date":"2014-08-25T0...
What's strange is that fiddler shows me no problem with the request and response. What does that error mean?
Node js. source code for calling elasticsearch (using request npm module):
function FindByQuery_promise(query) {
var deferred = Q.defer();
var r = request({
url: this._documentUrl + "/_search",
method: "POST",
json: true,
body: query
}, function(e, response, body) {
body = body || { error: null };
if (e || body.error) {
console.error("Error", e, body.error);
deferred.reject(new Error(e || body.error));
} else {
deferred.resolve(body);
}
});
return deferred.promise;
}
Any help would be approciated as I don't know when coding whether the response is valid or not. And also sometimes there is no error in dozens of thousands requests and then there are request errors after some hundreds requests...