I am trying to use multi-index search api of ES in java. The list of indexes over which i will be performing search operation will be known at run-time only. Using below snippet of code i am able to perform search when the indexes are known.
Search search = new Search.Builder(query).addIndex("index1")
How can i make it work for a dynamic list which i get on run time?