summaryrefslogtreecommitdiffstats
path: root/config-model/src/main/java/com/yahoo/searchdefinition/document
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@gmail.com>2020-11-29 18:46:58 +0100
committerJon Bratseth <bratseth@gmail.com>2020-11-29 18:46:58 +0100
commit4f92f1591f6fe49b90a37f67dbbdd20a2034bb38 (patch)
tree04491eec9720ac942daf7fd13c9f231f8f1c0fe1 /config-model/src/main/java/com/yahoo/searchdefinition/document
parenta7cc1248bade10175a73a4602f8452ccda6a102a (diff)
Reject queries searching tensor fields
Diffstat (limited to 'config-model/src/main/java/com/yahoo/searchdefinition/document')
-rw-r--r--config-model/src/main/java/com/yahoo/searchdefinition/document/SDField.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/document/SDField.java b/config-model/src/main/java/com/yahoo/searchdefinition/document/SDField.java
index ecc90e3d948..3fea5cc16e9 100644
--- a/config-model/src/main/java/com/yahoo/searchdefinition/document/SDField.java
+++ b/config-model/src/main/java/com/yahoo/searchdefinition/document/SDField.java
@@ -67,13 +67,13 @@ public class SDField extends Field implements TypedKey, FieldOperationContainer,
* to be specified in other rank profiles, while negative values
* turns the capability off.
*/
- private int literalBoost=-1;
+ private int literalBoost = -1;
/**
* The weight of this field. This is a percentage,
* so 100 is default to provide the identity transform.
*/
- private int weight=100;
+ private int weight = 100;
/**
* Indicates what kind of matching should be done on this field
@@ -87,7 +87,7 @@ public class SDField extends Field implements TypedKey, FieldOperationContainer,
* The stemming setting of this field, or null to use the default.
* Default is determined by the owning search definition.
*/
- private Stemming stemming=null;
+ private Stemming stemming = null;
/** How content of this field should be accent normalized etc. */
private NormalizeLevel normalizing = new NormalizeLevel();
@@ -179,6 +179,10 @@ public class SDField extends Field implements TypedKey, FieldOperationContainer,
if (type.dimensions().stream().anyMatch(d -> d.isIndexed() && d.size().isEmpty()))
throw new IllegalArgumentException("Illegal type in field " + name + " type " + type +
": Dense tensor dimensions must have a size");
+ addQueryCommand("type " + type);
+ }
+ else {
+ addQueryCommand("type " + dataType.getName());
}
if (populate || (dataType instanceof MapDataType)) {
populateWithStructFields(repo, name, dataType, recursion);