summaryrefslogtreecommitdiffstats
path: root/config-model/src/main/java/com/yahoo/searchdefinition/processing/IndexFieldNames.java
diff options
context:
space:
mode:
Diffstat (limited to 'config-model/src/main/java/com/yahoo/searchdefinition/processing/IndexFieldNames.java')
-rw-r--r--config-model/src/main/java/com/yahoo/searchdefinition/processing/IndexFieldNames.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/processing/IndexFieldNames.java b/config-model/src/main/java/com/yahoo/searchdefinition/processing/IndexFieldNames.java
index 8814cd8a61e..018183b91d8 100644
--- a/config-model/src/main/java/com/yahoo/searchdefinition/processing/IndexFieldNames.java
+++ b/config-model/src/main/java/com/yahoo/searchdefinition/processing/IndexFieldNames.java
@@ -11,8 +11,8 @@ import com.yahoo.vespa.model.container.search.QueryProfiles;
* Because of the way the parser works (allowing any token as identifier),
* it is not practical to limit the syntax of field names there, do it here.
* Important to disallow dash, has semantic in IL.
- * @author vegardh
*
+ * @author Vehard Havdal
*/
public class IndexFieldNames extends Processor {
@@ -23,9 +23,11 @@ public class IndexFieldNames extends Processor {
}
@Override
- public void process() {
+ public void process(boolean validate) {
+ if ( ! validate) return;
+
for (SDField field : search.allConcreteFields()) {
- if (!field.getName().matches(FIELD_NAME_REGEXP) && !legalDottedPositionField(field)) {
+ if ( ! field.getName().matches(FIELD_NAME_REGEXP) && ! legalDottedPositionField(field)) {
fail(search, field, " Not a legal field name. Legal expression: " + FIELD_NAME_REGEXP);
}
}
@@ -34,10 +36,12 @@ public class IndexFieldNames extends Processor {
/**
* In {@link CreatePositionZCurve} we add some .position and .distance fields for pos fields. Make an exception for those for now. For 6.0, rename
* to _position and _distance and delete this method.
+ *
* @param field an {@link com.yahoo.searchdefinition.document.SDField}
* @return true if allowed
*/
private boolean legalDottedPositionField(SDField field) {
return field.getName().endsWith(".position") || field.getName().endsWith(".distance");
}
+
}