summaryrefslogtreecommitdiffstats
path: root/container-search
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@oath.com>2018-02-05 13:20:28 +0100
committerJon Bratseth <bratseth@oath.com>2018-02-05 13:20:28 +0100
commitff42200912e298bb8d4f29da8d18c8b0079b04b7 (patch)
tree12fb6fd3f49489b462eaa94244be9c3d9a956755 /container-search
parent595d685af6fe641cf735278925f73a570e441ab5 (diff)
Use all query profiles and handle conflicts
Diffstat (limited to 'container-search')
-rw-r--r--container-search/src/main/java/com/yahoo/search/query/profile/types/FieldDescription.java1
-rw-r--r--container-search/src/main/java/com/yahoo/search/query/profile/types/FieldType.java7
-rw-r--r--container-search/src/main/java/com/yahoo/search/query/profile/types/TensorFieldType.java3
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; }