in my case it is not doing optimal it is even going some random index which are few week old. and I used exact query that you had.
for obvious reason I can't copy-paste screen shot of it. but it is looking in to total 7 index on "query Profile" window.
my metricbeat index is xyz-7.17.1 but it is looking in to four of the old index xyz-7.12.0
hmm. but if I select index as latest one it profiler shows only one being used, as obvious.
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.