Getting entire document from ElasticSearch


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


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


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?

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!


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