You can keep all the indexes in a dict like
{
query_engine_A: index_A.as_query_engine(),
query_engine_B: index_B.as_query_engine()
}
based on the file selected you can pick the engine and perform the ops
Second way I can think of is to use Router query engine and define instructions to each engine and let user query and instruction choose the engine.
More here:
https://docs.llamaindex.ai/en/stable/examples/query_engine/RouterQueryEngine.html