Skip to content

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

Closed
@pnowak85

Description

@pnowak85

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions