Getting entire document from ElasticSearch

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!

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!

Satish

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