Migration Get Assistanceedit

Index Upgrade Info Requestedit

An IndexUpgradeInfoRequest does not require any argument:

IndexUpgradeInfoRequest request = new IndexUpgradeInfoRequest(); 

Create a new request instance

Optional argumentsedit

The following arguments can optionally be provided:

request.indices("index1", "index2"); 

Set the indices to the request

request.indicesOptions(IndicesOptions.lenientExpandOpen()); 

Set the IndicesOptions to control how unavailable indices are resolved and how wildcard expressions are expanded

Executionedit

IndexUpgradeInfoResponse response = client.migration().getAssistance(request, RequestOptions.DEFAULT);

Responseedit

The returned IndexUpgradeInfoResponse contains the actions required for each index.

Map<String, UpgradeActionRequired> actions = response.getActions();
for (Map.Entry<String, UpgradeActionRequired> entry : actions.entrySet()) {
    String index = entry.getKey(); 
    UpgradeActionRequired actionRequired = entry.getValue(); 
}

Retrieve the index

Retrieve the action required for the migration of the current index