aboutsummaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
Diffstat (limited to 'config-model')
-rw-r--r--config-model/src/main/java/com/yahoo/searchdefinition/processing/AddExtraFieldsToDocument.java24
1 files changed, 15 insertions, 9 deletions
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/processing/AddExtraFieldsToDocument.java b/config-model/src/main/java/com/yahoo/searchdefinition/processing/AddExtraFieldsToDocument.java
index 9d933b8439d..51defffa00b 100644
--- a/config-model/src/main/java/com/yahoo/searchdefinition/processing/AddExtraFieldsToDocument.java
+++ b/config-model/src/main/java/com/yahoo/searchdefinition/processing/AddExtraFieldsToDocument.java
@@ -26,11 +26,6 @@ public class AddExtraFieldsToDocument extends Processor {
super(schema, deployLogger, rankProfileRegistry, queryProfiles);
}
- //TODO This is a tempoarry hack to avoid producing illegal code for fields not wanted anyway.
- private boolean dirtyLegalFieldNameCheck(String fieldName) {
- return ! fieldName.contains(".") && !"rankfeatures".equals(fieldName) && !"summaryfeatures".equals(fieldName);
- }
-
@Override
public void process(boolean validate, boolean documentsOnly) {
SDDocumentType document = schema.getDocument();
@@ -38,10 +33,21 @@ public class AddExtraFieldsToDocument extends Processor {
for (SDField field : schema.extraFieldList()) {
addSdField(schema, document, field, validate);
}
- //TODO Vespa 8 or sooner we should avoid the dirty addition of fields from dirty 'default' summary to document at all
- for (SummaryField field : schema.getSummary("default").getSummaryFields().values()) {
- if (dirtyLegalFieldNameCheck(field.getName())) {
- addSummaryField(schema, document, field, validate);
+ for (var docsum : schema.getSummaries().values()) {
+ for (var summaryField : docsum.getSummaryFields().values()) {
+ switch (summaryField.getTransform()) {
+ case NONE:
+ case BOLDED:
+ case DYNAMICBOLDED:
+ case DYNAMICTEASER:
+ case TEXTEXTRACTOR:
+ addSummaryField(schema, document, summaryField, validate);
+ break;
+ default:
+ // skip: generated from attribute or similar,
+ // so does not need to be included as an extra
+ // field in the document type
+ }
}
}
}