Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetIndicesFromAlias Throws Exception When Alias Doesn't Exist #108

Open
nfratin opened this issue Apr 5, 2019 · 1 comment
Open

GetIndicesFromAlias Throws Exception When Alias Doesn't Exist #108

nfratin opened this issue Apr 5, 2019 · 1 comment
Assignees
Labels

Comments

@nfratin
Copy link

nfratin commented Apr 5, 2019

I'm trying to use getIndicesFromAlias and it's throwing a JestElasticSearchException when it can't find the index.

This is the code that throws.

	public Set<String> getIndicesFromAlias(String aliasName) {
		JestResult result = execute(new GetAliases.Builder().addIndex(aliasName).build());
		if (!result.isSucceeded()) {
			return Collections.emptySet();
		}

It seems to me that it should be using the other execute and passing in acceptNotFound as true. So it should be:

JestResult result = execute(new GetAliases.Builder().addIndex(aliasName).build(), true);

Was wondering if this was the intended action, or should I be catching the 404 and dealing with it myself.

Thanks

@VanRoy VanRoy added the bug label Apr 6, 2019
@VanRoy VanRoy self-assigned this Apr 6, 2019
@VanRoy
Copy link
Owner

VanRoy commented Apr 6, 2019

Hi @nfratin , thanks for your feedback.

I will check that, I guess that it will be better with "acceptNotFound" enabled but I need to check the compatibility with many versions of ES.

Julien.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants