I am using elasticsearch js client and currently I send my requests in such a way:
// my service
function(indexName, docType, payload){
return elasticClient.search({
index: indexName,
type: docType,
body: payload
});
}
// how body is looks like
let payload = {
"query": {
"term": {
"field.id": {
"value": someId
}
}
}
};
But how can I write that without body? Just with get params:
GET /some_index/doc/380
// or (most my requests require params)
GET /some_index/doc/380?_source_exclude=customer.some_field
Also I will appreciate any advices about body builder libraries for node/js (elasticsearch docs suggest bodybuilder, elastic-builder or elastic.js for that).
Thanks!