0

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!

Community
  • 1
  • 1
Jack Hudzenko
  • 157
  • 3
  • 14

1 Answers1

0

Ok solution found here: https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-getsource

I just could not find right docs part, when that is explained.

Jack Hudzenko
  • 157
  • 3
  • 14