1

Is there a way so that I get only the data present in _source of my Document & not any other metadata like _index,_type,_id,_score while retrieving it from Index?

1

1 Answer 1

1

I got it how to do it.

GET /<index>/<type>/<id>/_source

will return only _source field.

Example: Create a document with ID 123

PUT /website/blog/123
{
  "title": "My first blog entry",
  "text":  "Just trying this out...",
  "date":  "2014/01/01"
}

To Retrieve just the _source field

GET /website/blog/123/_source

returned:

{
  "title": "My first blog entry",
  "text":  "Just trying this out...",
  "date":  "2014/01/01"
}
Sign up to request clarification or add additional context in comments.

1 Comment

how to do this in mongoosastic or npm elasticsearch module ??

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.