Skip to content

Commit

Permalink
Simplify operation filtering
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Farr <[email protected]>
  • Loading branch information
Xtansia committed Dec 18, 2024
1 parent ffb842f commit 866c3c1
Showing 1 changed file with 1 addition and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@
import static org.opensearch.client.codegen.utils.matcher.Matcher.is;
import static org.opensearch.client.codegen.utils.matcher.Matcher.isNot;
import static org.opensearch.client.codegen.utils.matcher.Matcher.isNull;
import static org.opensearch.client.codegen.utils.matcher.Matcher.isOneOf;
import static org.opensearch.client.codegen.utils.matcher.Matcher.or;
import static org.opensearch.client.codegen.utils.matcher.StringMatcher.contains;
import static org.opensearch.client.codegen.utils.matcher.StringMatcher.endsWith;

import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -49,44 +46,7 @@ public class CodeGenerator {
private static final Matcher<OperationGroup> OPERATION_MATCHER = or(
and(namespace(isNull()), name(is("info"))),
namespace(is("dangling_indices")),
and(
namespace(is("indices")),
name(
or(
isOneOf(
"add_block",
"analyze",
"clear_cache",
"clone",
"close",
"create",
"delete",
"exists",
"flush",
"forcemerge",
"get",
"get_upgrade",
"open",
"recovery",
"refresh",
"resolve_index",
"rollover",
"segments",
"shard_stores",
"shrink",
"split",
"stats",
"upgrade",
"validate_query"
),
contains("alias"),
contains("data_stream"),
and(endsWith("mapping"), isNot("get_field_mapping")),
endsWith("settings"),
endsWith("template")
)
)
),
and(namespace(is("indices")), name(isNot("get_field_mapping"))),
and(
namespace(is("ml")),
name(
Expand Down

0 comments on commit 866c3c1

Please sign in to comment.