Exists Alias API
editExists Alias API
editExists Alias Request
editThe Exists Alias API uses GetAliasesRequest
as its request object.
One or more aliases can be optionally provided either at construction
time or later on through the relevant setter method.
GetAliasesRequest request = new GetAliasesRequest(); GetAliasesRequest requestWithAlias = new GetAliasesRequest("alias1"); GetAliasesRequest requestWithAliases = new GetAliasesRequest(new String[]{"alias1", "alias2"});
Optional arguments
editThe following arguments can optionally be provided:
Setting |
Synchronous Execution
editboolean exists = client.indices().existsAlias(request);
Asynchronous Execution
editThe asynchronous execution of a exists alias request requires both a GetAliasesRequest
instance and an ActionListener
instance to be passed to the asynchronous
method:
The asynchronous method does not block and returns immediately. Once it is
completed the ActionListener
is called back using the onResponse
method
if the execution successfully completed or using the onFailure
method if
it failed.
A typical listener for the Boolean
response looks like:
Exists Alias Response
editThe Exists Alias API returns a boolean
that indicates whether the provided
alias (or aliases) was found or not.