diff options
Diffstat (limited to 'container-search/src/main/java/com')
3 files changed, 10 insertions, 1 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/query/profile/types/FieldDescription.java b/container-search/src/main/java/com/yahoo/search/query/profile/types/FieldDescription.java index 6be0dac6448..e8d8ecb02bb 100644 --- a/container-search/src/main/java/com/yahoo/search/query/profile/types/FieldDescription.java +++ b/container-search/src/main/java/com/yahoo/search/query/profile/types/FieldDescription.java @@ -4,6 +4,7 @@ package com.yahoo.search.query.profile.types; import com.google.common.collect.ImmutableList; import com.yahoo.processing.request.CompoundName; import com.yahoo.search.query.profile.QueryProfile; +import com.yahoo.tensor.TensorType; import java.util.Arrays; import java.util.Collections; diff --git a/container-search/src/main/java/com/yahoo/search/query/profile/types/FieldType.java b/container-search/src/main/java/com/yahoo/search/query/profile/types/FieldType.java index 69c07843681..3bfd33668e6 100644 --- a/container-search/src/main/java/com/yahoo/search/query/profile/types/FieldType.java +++ b/container-search/src/main/java/com/yahoo/search/query/profile/types/FieldType.java @@ -6,6 +6,7 @@ import com.yahoo.search.query.profile.QueryProfileRegistry; import com.yahoo.search.query.profile.compiled.CompiledQueryProfileRegistry; import com.yahoo.search.yql.YqlQuery; import com.yahoo.tensor.Tensor; +import com.yahoo.tensor.TensorType; /** * Superclass of query type field types. @@ -43,6 +44,12 @@ public abstract class FieldType { public abstract Object convertFrom(Object o, CompiledQueryProfileRegistry registry); /** + * Returns this type as a tensor type: The true tensor type is this is a tensor field an an empty type - + * interpreted as a double in numerical contexts - otherwise + */ + public TensorType asTensorType() { return TensorType.empty; } + + /** * Returns the field type for a given string name. * * @param typeString a type string - a primitive name, "query-profile" or "query-profile:profile-name" diff --git a/container-search/src/main/java/com/yahoo/search/query/profile/types/TensorFieldType.java b/container-search/src/main/java/com/yahoo/search/query/profile/types/TensorFieldType.java index 53ab7aefafd..9699a72cb31 100644 --- a/container-search/src/main/java/com/yahoo/search/query/profile/types/TensorFieldType.java +++ b/container-search/src/main/java/com/yahoo/search/query/profile/types/TensorFieldType.java @@ -21,7 +21,8 @@ public class TensorFieldType extends FieldType { } /** Returns information about the type of tensor this will hold */ - public TensorType type() { return type; } + @Override + public TensorType asTensorType() { return type; } @Override public Class getValueClass() { return Tensor.class; } |