Skip to content

Commit

Permalink
Add NONE multiTypeResolutionBehavior
Browse files Browse the repository at this point in the history
Signed-off-by: Andre Kurait <[email protected]>
  • Loading branch information
AndreKurait committed Dec 10, 2024
1 parent 1e81a14 commit b0cca39
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ public enum MultiTypeResolutionBehavior {
private static final ObjectMapper MAPPER = new ObjectMapper();
public final MultiTypeResolutionBehavior multiTypeResolutionBehavior;

// Default with SPLIT
// Default with NONE
public IndexMappingTypeRemoval() {
this(MultiTypeResolutionBehavior.SPLIT);
this(MultiTypeResolutionBehavior.NONE);
}

@Override
Expand All @@ -76,6 +76,9 @@ public CanApplyResult canApply(final Index index) {
// 1. <pre>{"mappings": [{ "foo": {...} }, { "bar": {...} }]}</pre>
// 2. <pre>{"mappings": [{ "foo": {...}, "bar": {...} }]}</pre>
if (mappingNode.isArray() && (mappingNode.size() > 1 || mappingNode.get(0).size() > 1)) {
if (MultiTypeResolutionBehavior.NONE.equals(multiTypeResolutionBehavior)) {
return new Unsupported("No multi type resolution behavior declared");
}
if (MultiTypeResolutionBehavior.SPLIT.equals(multiTypeResolutionBehavior)) {
return new Unsupported("Split on multiple mapping types is not supported");
}
Expand Down

0 comments on commit b0cca39

Please sign in to comment.