# Getting entire document from ElasticSearch

**URL:** <https://discuss.elastic.co/t/getting-entire-document-from-elasticsearch/132186>\
**Category:** Elasticsearch\
**Created:** [May 16, 2018, 5:09pm UTC](https://discuss.elastic.co/t/getting-entire-document-from-elasticsearch/132186 "2018-05-16T17:09:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![satishrao](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@satishrao](https://discuss.elastic.co/u/satishrao)\
**Post date:** [May 16, 2018, 5:09pm UTC](https://discuss.elastic.co/t/getting-entire-document-from-elasticsearch/132186/1 "2018-05-16T17:09:37Z")

</div>

Ahoy!

I am using the nodejs elasticsearch js driver to get entire content of all documents in elasticsearch from a small index that would contain about 50 documents. Currently it has only one document  
When I use {"query":{"match\_all":{}}} , I get back only the \_id metadata for the index

{"took":8,"timed\_out":false,"\_shards":{"total":5,"successful":5,"skipped":0,"failed":0},"hits":{"total":1,"max\_score":1,"hits":[{"\_index":"cb\_inventory","\_type":"cb\_inventory","\_id":"AWNlt8bCsD7GhmNOAu4Q","\_score":1,"\_source":{}}]}}

Is there a way for me to get the entire content of the document rather than just the \_id ?

Thanks!

---

<div class="post-metadata">

**Author:** ![polyfractal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polyfractal/32/48162_2.png) [@polyfractal](https://discuss.elastic.co/u/polyfractal)\
**Post date:** [May 17, 2018, 4:31pm UTC](https://discuss.elastic.co/t/getting-entire-document-from-elasticsearch/132186/2 "2018-05-17T16:31:27Z")

</div>

Can you show the complete request code? Elasticsearch returns the entire source document by default when searching, so either something is configured incorrectly in the search request or potentially the document doesn't have any source?

---

<div class="post-metadata">

**Author:** ![satishrao](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@satishrao](https://discuss.elastic.co/u/satishrao)\
**Post date:** [May 21, 2018, 4:13pm UTC](https://discuss.elastic.co/t/getting-entire-document-from-elasticsearch/132186/3 "2018-05-21T16:13:46Z")

</div>

Hi Zachary,  
Apologize for the delayed reply! I found the problem. I had installed a Couchbase ElasticSearch plugin, and as part of the plugin it configures a template which restricts output to only \_id.  
I deleted the template, and configured another similar one with source as enabled, and it works fine.  
Thanks for responding. I hope this will help others who install the couchbase template!

Satish

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 18, 2018, 4:22pm UTC](https://discuss.elastic.co/t/getting-entire-document-from-elasticsearch/132186/4 "2018-06-18T16:22:52Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
