Spark - How to find the Index ID for a search request

Hi, I have multiple indices (automatically created as application requirement) created at ES with different types. With spark support, I can query and find the relevant document but can not find the index id attached with, where I need to insert more documents to the same index/type.

Also I would like to know whether ES + Spark support alias creation, if so any resources to dig into?

Not sure what you mean by that but have you tried turning on metadata reading?

Hi costin, I have turned on metadata reading, but now indices are not created with JavaESPark.saveToES method, as I mentioned earlier I'm searching document across indices, and need to retrieve relevant index id where a document resides

Sorry but I don't follow.

It doesn't matter - saveToES writes data to ES. The configuration option is for reading, meaning it's useful for things like JavaEsSpark.esRDD.