diff options
author | Arne Juul <arnej@yahooinc.com> | 2023-02-01 10:00:38 +0000 |
---|---|---|
committer | Arne Juul <arnej@yahooinc.com> | 2023-02-01 10:00:38 +0000 |
commit | 3cfb3337ba83d4cf69df70dd219c2268a95f852d (patch) | |
tree | 3312892d3c49e667e8e2ac20eab5f1e94a97f34c /config-model/src/main/java/com/yahoo/schema/parser/ParsedRankProfile.java | |
parent | 179daa38c12471ec9de4e48ec91865c8a336d8a8 (diff) |
add parsing (only) of container-phase in schema
Diffstat (limited to 'config-model/src/main/java/com/yahoo/schema/parser/ParsedRankProfile.java')
-rw-r--r-- | config-model/src/main/java/com/yahoo/schema/parser/ParsedRankProfile.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/config-model/src/main/java/com/yahoo/schema/parser/ParsedRankProfile.java b/config-model/src/main/java/com/yahoo/schema/parser/ParsedRankProfile.java index 64dd8dd0ad4..2de7fab09f4 100644 --- a/config-model/src/main/java/com/yahoo/schema/parser/ParsedRankProfile.java +++ b/config-model/src/main/java/com/yahoo/schema/parser/ParsedRankProfile.java @@ -53,6 +53,8 @@ class ParsedRankProfile extends ParsedBlock { private final Map<Reference, RankProfile.Constant> constants = new LinkedHashMap<>(); private final Map<Reference, RankProfile.Input> inputs = new LinkedHashMap<>(); private final List<OnnxModel> onnxModels = new ArrayList<>(); + private Integer containerPhaseRerankCount = null; + private String containerPhaseExpression = null; ParsedRankProfile(String name) { super(name, "rank-profile"); @@ -77,6 +79,8 @@ class ParsedRankProfile extends ParsedBlock { List<ParsedRankFunction> getFunctions() { return List.copyOf(functions.values()); } List<MutateOperation> getMutateOperations() { return List.copyOf(mutateOperations); } List<String> getInherited() { return List.copyOf(inherited); } + Optional<Integer> getContainerPhaseRerankCount() { return Optional.ofNullable(this.containerPhaseRerankCount); } + Optional<String> getContainerPhaseExpression() { return Optional.ofNullable(this.containerPhaseExpression); } Map<String, Boolean> getFieldsWithRankFilter() { return Collections.unmodifiableMap(fieldsRankFilter); } Map<String, Integer> getFieldsWithRankWeight() { return Collections.unmodifiableMap(fieldsRankWeight); } @@ -197,11 +201,21 @@ class ParsedRankProfile extends ParsedBlock { this.secondPhaseExpression = expression; } + void setContainerPhaseExpression(String expression) { + verifyThat(containerPhaseExpression == null, "already has container-phase expression"); + this.containerPhaseExpression = expression; + } + + void setContainerPhaseRerankCount(int count) { + verifyThat(containerPhaseRerankCount == null, "already has container-phase rerank-count"); + this.containerPhaseRerankCount = count; + } + void setStrict(boolean strict) { verifyThat(this.strict == null, "already has strict"); this.strict = strict; } - + void setTermwiseLimit(double limit) { verifyThat(termwiseLimit == null, "already has termwise-limit"); this.termwiseLimit = limit; |