diff options
author | Jon Bratseth <bratseth@oath.com> | 2019-06-13 07:12:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-13 07:12:23 +0200 |
commit | 0e20abc33aa88066aedadd43b09353d115d5928b (patch) | |
tree | 159df75408a4eb188b13a532fb42b8896083cfc9 /config-model/src/main/java/com/yahoo/searchdefinition/FeatureNames.java | |
parent | 17b6704b20a073a4961baefd1be58dd48012bec4 (diff) |
Revert "Revert "Require constant() for large constants and fix a type resolving bug""
Diffstat (limited to 'config-model/src/main/java/com/yahoo/searchdefinition/FeatureNames.java')
-rw-r--r-- | config-model/src/main/java/com/yahoo/searchdefinition/FeatureNames.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/FeatureNames.java b/config-model/src/main/java/com/yahoo/searchdefinition/FeatureNames.java index 2f41b172ab6..1e133d0b8f4 100644 --- a/config-model/src/main/java/com/yahoo/searchdefinition/FeatureNames.java +++ b/config-model/src/main/java/com/yahoo/searchdefinition/FeatureNames.java @@ -34,6 +34,12 @@ public class FeatureNames { return name.equals("attribute") || name.equals("constant") || name.equals("query"); } + /** Returns true if this is a constant */ + public static boolean isConstantFeature(Reference reference) { + if ( ! isSimpleFeature(reference)) return false; + return reference.name().equals("constant"); + } + /** * Returns the single argument of the given feature name, without any quotes, * or empty if it is not a valid query, attribute or constant feature name |