title: Retrieve contents of _source only- Elasticsearch ( Node JS)
body: <p>According to <a href="https://www.elastic.co/guide/en/elasticsearch/guide/current/get-doc.html" rel="nofollow noreferrer">Retrieving a document</a> documentation</p>
  
  <pre><code> GET /website/blog/123/_source
  </code></pre>
  
  <p>would directly return the document stored inside the <code>_source</code> field.
  I'm currently using Node JS's express framework. How should I implement this in my code? </p>
  
  <pre><code>esClient.search({
          index: "myIndex",
          type: "myType",
          body: {
  
              "query": {
                  "match_all": {}
              },
              "size": 3,
              "from": 1
  
          }
      }).then(function (resp) {
          var result = resp.hits.hits;
          res.status(200).send({data: {recommendations: result, showItemFrom: showItemFrom}})
      }, function (err) {
          console.trace(err.message)
          res.status(500).send({data: err.message})
      })
  </code></pre>
  
  <p>I'm getting the response this way...</p>
  
  <pre><code>[
    "_source":{
               {
                   "id": 1,
                   "title": "Test"
                  }
              } 
  ]
  </code></pre>
  
  <p>However, I want it this way...</p>
  
  <pre><code>[
     {
        id:1,
        title:"Test"
     }
  ]
  </code></pre>