|
@@ -177,6 +177,9 @@ public class IndicesAliasesRequest extends AcknowledgedRequest<IndicesAliasesReq
|
|
|
}
|
|
|
|
|
|
private static final ObjectParser<AliasActions, Void> ADD_PARSER = parser(ADD.getPreferredName(), AliasActions::add);
|
|
|
+ private static final ObjectParser<AliasActions, Void> REMOVE_PARSER = parser(REMOVE.getPreferredName(), AliasActions::remove);
|
|
|
+ private static final ObjectParser<AliasActions, Void> REMOVE_INDEX_PARSER = parser(REMOVE_INDEX.getPreferredName(),
|
|
|
+ AliasActions::removeIndex);
|
|
|
static {
|
|
|
ADD_PARSER.declareObject(AliasActions::filter, (parser, m) -> {
|
|
|
try {
|
|
@@ -191,11 +194,8 @@ public class IndicesAliasesRequest extends AcknowledgedRequest<IndicesAliasesReq
|
|
|
ADD_PARSER.declareField(AliasActions::searchRouting, XContentParser::text, SEARCH_ROUTING, ValueType.INT);
|
|
|
ADD_PARSER.declareField(AliasActions::writeIndex, XContentParser::booleanValue, IS_WRITE_INDEX, ValueType.BOOLEAN);
|
|
|
ADD_PARSER.declareField(AliasActions::isHidden, XContentParser::booleanValue, IS_HIDDEN, ValueType.BOOLEAN);
|
|
|
- ADD_PARSER.declareField(AliasActions::mustExist, XContentParser::booleanValue, MUST_EXIST, ValueType.BOOLEAN);
|
|
|
+ REMOVE_PARSER.declareField(AliasActions::mustExist, XContentParser::booleanValue, MUST_EXIST, ValueType.BOOLEAN);
|
|
|
}
|
|
|
- private static final ObjectParser<AliasActions, Void> REMOVE_PARSER = parser(REMOVE.getPreferredName(), AliasActions::remove);
|
|
|
- private static final ObjectParser<AliasActions, Void> REMOVE_INDEX_PARSER = parser(REMOVE_INDEX.getPreferredName(),
|
|
|
- AliasActions::removeIndex);
|
|
|
|
|
|
/**
|
|
|
* Parser for any one {@link AliasAction}.
|
|
@@ -524,6 +524,9 @@ public class IndicesAliasesRequest extends AcknowledgedRequest<IndicesAliasesReq
|
|
|
if (null != isHidden) {
|
|
|
builder.field(IS_HIDDEN.getPreferredName(), isHidden);
|
|
|
}
|
|
|
+ if (null != mustExist) {
|
|
|
+ builder.field(MUST_EXIST.getPreferredName(), mustExist);
|
|
|
+ }
|
|
|
builder.endObject();
|
|
|
builder.endObject();
|
|
|
return builder;
|
|
@@ -544,6 +547,7 @@ public class IndicesAliasesRequest extends AcknowledgedRequest<IndicesAliasesReq
|
|
|
+ ",indexRouting=" + indexRouting
|
|
|
+ ",searchRouting=" + searchRouting
|
|
|
+ ",writeIndex=" + writeIndex
|
|
|
+ + ",mustExist=" + mustExist
|
|
|
+ "]";
|
|
|
}
|
|
|
|
|
@@ -562,12 +566,13 @@ public class IndicesAliasesRequest extends AcknowledgedRequest<IndicesAliasesReq
|
|
|
&& Objects.equals(indexRouting, other.indexRouting)
|
|
|
&& Objects.equals(searchRouting, other.searchRouting)
|
|
|
&& Objects.equals(writeIndex, other.writeIndex)
|
|
|
- && Objects.equals(isHidden, other.isHidden);
|
|
|
+ && Objects.equals(isHidden, other.isHidden)
|
|
|
+ && Objects.equals(mustExist, other.mustExist);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public int hashCode() {
|
|
|
- return Objects.hash(type, indices, aliases, filter, routing, indexRouting, searchRouting, writeIndex, isHidden);
|
|
|
+ return Objects.hash(type, indices, aliases, filter, routing, indexRouting, searchRouting, writeIndex, isHidden, mustExist);
|
|
|
}
|
|
|
}
|
|
|
|