I have a search query to make across multiple indexes. To enable this as per the documentation, I need to provide a comma-separated list of indexes.
But when I try to do it as: es.search(index='index1,index2',body=body)
I get no result:
{u'hits': {u'hits': [], u'total': 0, u'max_score': None}, u'_shards': {u'successful': 10, u'failed': 0, u'skipped': 0, u'total': 10}, u'took': 1, u'timed_out': False}
However, index='_all' works to search across all index. Am I doing something incorrectly here or is there some issue with this functionality? Thanks.
According to the documentation posted by you:
In your code you pass a string:
es.search(index='index1,index2',body=body)
So you should simply:
es.search(index=['index1','index2'],body=body)
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