There is no need to implement this in Python. You can just use Rally's search operation as is in your track. Also, Rally does nothing special here and you can just use the multiple indices syntax of Elasticsearch, e.g.
Using an index range is not possible but if you have some kind of timestamp in your data you can use a range query indeed as Elasticsearch rewrites your query anyway since 5.0 to only hit matching shards (see the blog post Instant Aggregations).
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.