node.js - Node+ElasticSearch: Sending a body on a GET request? -
i using node.js , request
module create backend, , we've chose elasticsearch our data storage. fine far, except seems node doesn't support request bodies on requests? necessary elasticsearch's _search
api, expects requests part of semantic design. there solution force node send request body in cases of request, or mean use _search
on elasticsearch http verb?
function elasticget(url, data) { data = data || {}; return q.nfcall(request.get, { uri: url, body: json.stringify(data) //<-- noop }).then(function(response) { return json.parse(response[1]); }, function(err) { console.log(err); }); }
the _search
api accepts post
verb.
Comments
Post a Comment