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!

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.