elasticsearch - How to retrieve all document ids (_id) in a specific index -
i trying retrieve documents in index, while getting _id field back.
basically want retrieve document ids have.
while using:
{ "query": { "match_all": {} }, "fields": [] } the hits contain: "_index", "_type", "_id" , "_score", "_source" way more need.
edit(answer): problem used kopf run queries, , results not accurate (got _source , more..)! when using curl got correct results!
so above query achieved needed! can use:
{ "query": { "match_all": {} }, "_source": false, } or
{ "query": { "match_all": {} }, "fields": ["_id"] }
for elasticsearch, can specific _source fields using fields array.
_index, _type, _id, _score must returned elasticsearch.
there no way remove them response.
Comments
Post a Comment