Convert queries with multiple indexes