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

RequestFactory.toElasticsearchIndicesOptions fails on empty options or wildcard states #2075

Closed
pnowak85 opened this issue Feb 1, 2022 · 1 comment · Fixed by #2076
Closed
Labels
status: waiting-for-triage An issue we've not yet triaged

Comments

@pnowak85
Copy link
Contributor

pnowak85 commented Feb 1, 2022

If you try to create custom IndicesOptions with either an empty set of Option or WildcardState you get an IllegalArgumentException:

java.lang.IllegalArgumentException: Collection is empty

	at java.util.EnumSet.copyOf(EnumSet.java:174)
	at org.springframework.data.elasticsearch.core.RequestFactory.toElasticsearchIndicesOptions(RequestFactory.java:1696)

The empty Option or WildcardState should be allowed, as for example the default STRICT_SINGLE_INDEX_NO_EXPAND_FORBID_CLOSED IndicesOption has an empty set of WildcardState and therefor fails if you use it.

I have a working fix (and test), will create a MR once i have resolved my upstream conflicts :D

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 1, 2022
pnowak85 added a commit to pnowak85/spring-data-elasticsearch that referenced this issue Feb 1, 2022
pnowak85 added a commit to pnowak85/spring-data-elasticsearch that referenced this issue Feb 1, 2022
pnowak85 added a commit to pnowak85/spring-data-elasticsearch that referenced this issue Feb 1, 2022
pnowak85 added a commit to pnowak85/spring-data-elasticsearch that referenced this issue Feb 1, 2022
@pnowak85
Copy link
Contributor Author

pnowak85 commented Feb 1, 2022

backport to 4.3.x would be nice, as we are currently facing this issue in 4.3.1

sothawo pushed a commit that referenced this issue Feb 1, 2022
…empty Option or WildcardState set.

Original Pull Request #2076
Closes #2075
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
2 participants