aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/main/java/com/yahoo/schema/derived
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@vespa.ai>2023-09-22 16:53:50 +0200
committerJon Bratseth <bratseth@vespa.ai>2023-09-22 16:53:50 +0200
commit82730b650885f5a1f366980ff7cdf900aa0844ff (patch)
treeb4ff28dd1f80ac54a0b6144d81367887ef30ef9e /config-model/src/main/java/com/yahoo/schema/derived
parentad6d36794fe2a51e6f5eacde01eb648d7c76c379 (diff)
Output gram for summary fields where the source is gram
Diffstat (limited to 'config-model/src/main/java/com/yahoo/schema/derived')
-rw-r--r--config-model/src/main/java/com/yahoo/schema/derived/IndexInfo.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/config-model/src/main/java/com/yahoo/schema/derived/IndexInfo.java b/config-model/src/main/java/com/yahoo/schema/derived/IndexInfo.java
index 7d88985b2d5..a21aefc9f71 100644
--- a/config-model/src/main/java/com/yahoo/schema/derived/IndexInfo.java
+++ b/config-model/src/main/java/com/yahoo/schema/derived/IndexInfo.java
@@ -82,7 +82,7 @@ public class IndexInfo extends Derived implements IndexInfoConfig.Producer {
}
// Commands for summary fields
- // TODO: Move to fieldinfo and implement differently. This is not right
+ // TODO: Move to schemainfo and implement differently
for (SummaryField summaryField : schema.getUniqueNamedSummaryFields().values()) {
if (summaryField.getTransform().isTeaser()) {
addIndexCommand(summaryField.getName(), CMD_DYNTEASER);
@@ -90,6 +90,13 @@ public class IndexInfo extends Derived implements IndexInfoConfig.Producer {
if (summaryField.getTransform().isBolded()) {
addIndexCommand(summaryField.getName(), CMD_HIGHLIGHT);
}
+
+ var sourceField = schema.getField(summaryField.getSourceField()); // Take the first as they should all be consistent
+ if (sourceField != null && sourceField.getMatching().getType().equals(MatchType.GRAM)) {
+ addIndexCommand(summaryField.getName(),
+ "ngram " + (sourceField.getMatching().getGramSize() > 0 ? sourceField.getMatching().getGramSize() : NGramMatch.DEFAULT_GRAM_SIZE));
+
+ }
}
}