Thursday 1 October 2015

ElasticSearch : Get only source of document (excluding metadata)

By default GET retrieve entire document including metadata. Some times, you may not interested about metadata, in that case use following statement to get only source of the document.

GET xyz/employees/1/_source

Above snippet, returns only source of the document.

{
   "firstName": "Phalgun",
   "lastName": "Garimella",
   "hobbies": [
      "Watching movies",
      "Stamp collection",
      "Reading books",
      "Playing Cricket"
   ],
   "age": 30
}


Prevoius                                                 Next                                                 Home

No comments:

Post a Comment