New

The executive guide to generative AI

Read more
IMPORTANT: This documentation is no longer updated. Refer to Elastic's version policy and the latest documentation.

Migration Get Assistance

edit

Index Upgrade Info Request

edit

An IndexUpgradeInfoRequest does not require any argument:

IndexUpgradeInfoRequest request = new IndexUpgradeInfoRequest(); 

Create a new request instance

Optional arguments

edit

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

Execution

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

Response

edit

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

Was this helpful?
Feedback