I want to fetch documents with multiple ids using _mget API of elasticsearch python.
I'm using es.mget()
method on a Elasticsearch object. However, I don't know what to provide as an argument to body param. should it be comma separated list of ids or a list of docs with _id
mentioned.
I've tried both ways and I keep receiving an exception:
elasticsearch.exceptions.RequestError
mget()
is used when you retrieve multiple document via document id.
You should pass body = {'ids': [doc_id1, doc_id2]}
as describe ES Multi GET API
es_client.mget(index = 'bank',
doc_type = 'account',
body = {'ids': ['100', '101']})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With