Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,10 @@ public static JsonNode createQueryWithOperatorForTag(String operator, String att
return createDSLForTagKeyValue(attributeName, attributeValueNode);
}
}
case POLICY_FILTER_CRITERIA_NOT_EQUALS -> {
case POLICY_FILTER_CRITERIA_NOT_EQUALS, POLICY_FILTER_CRITERIA_NOT_IN -> {
ObjectNode mustNotNode = queryNode.putObject("bool").putObject("must_not");
if (attributeValueNode.isArray()) {
ArrayNode shouldArray = mustNotNode.putArray("should");
ArrayNode shouldArray = mustNotNode.putObject("bool").putArray("should");
for (JsonNode valueNode : attributeValueNode) {
shouldArray.add(createDSLForTagKeyValue(attributeName, valueNode));
}
Expand All @@ -197,17 +197,6 @@ public static JsonNode createQueryWithOperatorForTag(String operator, String att
shouldArray.add(createDSLForTagKeyValue(attributeName, attributeValueNode));
}
}
case POLICY_FILTER_CRITERIA_NOT_IN -> {
ObjectNode notInMustNot = queryNode.putObject("bool").putObject("must_not");
ArrayNode notInShouldArray = notInMustNot.putArray("should");
if (attributeValueNode.isArray()) {
for (JsonNode valueNode : attributeValueNode) {
notInShouldArray.add(createDSLForTagKeyValue(attributeName, valueNode));
}
} else {
notInShouldArray.add(createDSLForTagKeyValue(attributeName, attributeValueNode));
}
}
default -> LOG.warn("Found unknown operator {}", operator);
}
return queryNode;
Expand Down
Loading