please help me.
I got many data of the same type. In some cases, the known data must exist, but I need to further confirm which index the data is under. I chose to judge in the following way, but cannot found then throw exception.
This happens occasionally . elasticsearch version : 6.8.23,3 nodes
example:
( indexs is this type of elasticsearch indexs )
for (String index:indexs){
exists = client.prepareGet(index, model, id)
.setFetchSource(false)
.execute()
.actionGet().isExists();
if(exists){
return index;
}
}
throw new RuntimeException("cannot fount index");