diff --git a/server/src/main/java/org/elasticsearch/action/support/IndicesOptions.java b/server/src/main/java/org/elasticsearch/action/support/IndicesOptions.java index 65fb2b75d693f..a44172987f5cd 100644 --- a/server/src/main/java/org/elasticsearch/action/support/IndicesOptions.java +++ b/server/src/main/java/org/elasticsearch/action/support/IndicesOptions.java @@ -18,15 +18,18 @@ */ package org.elasticsearch.action.support; +import org.elasticsearch.ElasticsearchParseException; +import org.elasticsearch.common.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.ToXContentFragment; import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.common.xcontent.XContentParser.Token; import org.elasticsearch.rest.RestRequest; import java.io.IOException; -import java.util.Collection; import java.util.EnumSet; import java.util.Locale; import java.util.Map; @@ -58,25 +61,7 @@ public static EnumSet parseParameter(Object value, EnumSet states, XConten } return builder; } + + private static void updateSetForValue(EnumSet states, String wildcard) { + switch (wildcard) { + case "open": + states.add(OPEN); + break; + case "closed": + states.add(CLOSED); + break; + case "hidden": + states.add(HIDDEN); + break; + case "none": + states.clear(); + break; + case "all": + states.addAll(EnumSet.allOf(WildcardStates.class)); + break; + default: + throw new IllegalArgumentException("No valid expand wildcard value [" + wildcard + "]"); + } + } } public enum Option { @@ -145,11 +152,6 @@ public IndicesOptions(EnumSet