summaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2021-03-23 17:03:28 +0100
committerGitHub <noreply@github.com>2021-03-23 17:03:28 +0100
commitf8cf0739f35de7b8da799e5206421ec5dc66df49 (patch)
tree9820da3e8def61610631d1ca4e978a10471cc50f /config-model
parent2da65b6a987716d59a27a720a03f34fc6c9a596b (diff)
parentf86aedaee7c84fff85bd97099b7e08db3e4d5313 (diff)
Merge pull request #17122 from vespa-engine/balder/orderting-2-type
Balder/orderting 2 type
Diffstat (limited to 'config-model')
-rw-r--r--config-model/src/main/java/com/yahoo/searchdefinition/derived/AttributeFields.java17
-rw-r--r--config-model/src/main/java/com/yahoo/searchdefinition/document/Attribute.java8
-rw-r--r--config-model/src/main/java/com/yahoo/searchdefinition/document/Dictionary.java16
-rw-r--r--config-model/src/main/java/com/yahoo/searchdefinition/document/SDField.java10
-rw-r--r--config-model/src/main/java/com/yahoo/searchdefinition/fieldoperation/AttributeOperation.java7
-rw-r--r--config-model/src/main/java/com/yahoo/searchdefinition/fieldoperation/DictionaryOperation.java35
-rw-r--r--config-model/src/main/java/com/yahoo/searchdefinition/processing/DictionaryProcessor.java41
-rw-r--r--config-model/src/main/java/com/yahoo/searchdefinition/processing/PredicateProcessor.java8
-rw-r--r--config-model/src/main/java/com/yahoo/searchdefinition/processing/Processing.java1
-rw-r--r--config-model/src/main/java/com/yahoo/searchdefinition/processing/Processor.java2
-rw-r--r--config-model/src/main/javacc/SDParser.jj32
-rw-r--r--config-model/src/test/derived/advanced/attributes.cfg1
-rw-r--r--config-model/src/test/derived/array_of_struct_attribute/attributes.cfg2
-rw-r--r--config-model/src/test/derived/attributeprefetch/attributes.cfg18
-rw-r--r--config-model/src/test/derived/attributes/attributes.cfg18
-rw-r--r--config-model/src/test/derived/complex/attributes.cfg9
-rw-r--r--config-model/src/test/derived/hnsw_index/attributes.cfg2
-rw-r--r--config-model/src/test/derived/imported_fields_inherited_reference/attributes.cfg4
-rw-r--r--config-model/src/test/derived/imported_position_field/attributes.cfg2
-rw-r--r--config-model/src/test/derived/imported_struct_fields/attributes.cfg8
-rw-r--r--config-model/src/test/derived/importedfields/attributes.cfg8
-rw-r--r--config-model/src/test/derived/inheritance/attributes.cfg3
-rw-r--r--config-model/src/test/derived/inheritfromparent/attributes.cfg1
-rw-r--r--config-model/src/test/derived/map_attribute/attributes.cfg3
-rw-r--r--config-model/src/test/derived/map_of_struct_attribute/attributes.cfg5
-rw-r--r--config-model/src/test/derived/music/attributes.cfg11
-rw-r--r--config-model/src/test/derived/newrank/attributes.cfg10
-rw-r--r--config-model/src/test/derived/predicate_attribute/attributes.cfg1
-rw-r--r--config-model/src/test/derived/prefixexactattribute/attributes.cfg2
-rw-r--r--config-model/src/test/derived/reference_fields/attributes.cfg3
-rw-r--r--config-model/src/test/derived/sorting/attributes.cfg3
-rw-r--r--config-model/src/test/derived/tensor/attributes.cfg5
-rw-r--r--config-model/src/test/derived/types/attributes.cfg13
-rw-r--r--config-model/src/test/java/com/yahoo/searchdefinition/processing/BoldingTestCase.java2
-rw-r--r--config-model/src/test/java/com/yahoo/searchdefinition/processing/DictionaryTestCase.java125
35 files changed, 424 insertions, 12 deletions
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/derived/AttributeFields.java b/config-model/src/main/java/com/yahoo/searchdefinition/derived/AttributeFields.java
index 3e421f9ba05..4a415fccbcc 100644
--- a/config-model/src/main/java/com/yahoo/searchdefinition/derived/AttributeFields.java
+++ b/config-model/src/main/java/com/yahoo/searchdefinition/derived/AttributeFields.java
@@ -6,6 +6,7 @@ import com.yahoo.document.DataType;
import com.yahoo.document.PositionDataType;
import com.yahoo.searchdefinition.Search;
import com.yahoo.searchdefinition.document.Attribute;
+import com.yahoo.searchdefinition.document.Dictionary;
import com.yahoo.searchdefinition.document.ImmutableSDField;
import com.yahoo.searchdefinition.document.Ranking;
import com.yahoo.searchdefinition.document.Sorting;
@@ -251,9 +252,25 @@ public class AttributeFields extends Derived implements AttributesConfig.Produce
ib.hnsw.multithreadedindexing(params.multiThreadedIndexing());
aaB.index(ib);
}
+ Dictionary dictionary = attribute.getDictionary();
+ if (dictionary != null) {
+ aaB.dictionary.type(convert(dictionary.getType()));
+ }
return aaB;
}
+ private static AttributesConfig.Attribute.Dictionary.Type.Enum convert(Dictionary.Type type) {
+ switch (type) {
+ case BTREE:
+ return AttributesConfig.Attribute.Dictionary.Type.BTREE;
+ case HASH:
+ return AttributesConfig.Attribute.Dictionary.Type.HASH;
+ case BTREE_AND_HASH:
+ return AttributesConfig.Attribute.Dictionary.Type.BTREE_AND_HASH;
+ }
+ return AttributesConfig.Attribute.Dictionary.Type.BTREE;
+ }
+
public void getConfig(AttributesConfig.Builder builder, FieldSet fs) {
for (Attribute attribute : attributes.values()) {
if (isAttributeInFieldSet(attribute, fs)) {
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/document/Attribute.java b/config-model/src/main/java/com/yahoo/searchdefinition/document/Attribute.java
index 8cf862a72af..f230a7c10eb 100644
--- a/config-model/src/main/java/com/yahoo/searchdefinition/document/Attribute.java
+++ b/config-model/src/main/java/com/yahoo/searchdefinition/document/Attribute.java
@@ -78,6 +78,8 @@ public final class Attribute implements Cloneable, Serializable {
/** The aliases for this attribute */
private final Set<String> aliases = new LinkedHashSet<>();
+ private Dictionary dictionary = new Dictionary();
+
/**
* True if this attribute should be returned during first pass of search.
* Null means make the default decision for this kind of attribute
@@ -208,6 +210,7 @@ public final class Attribute implements Cloneable, Serializable {
public Optional<HnswIndexParams> hnswIndexParams() { return hnswIndexParams; }
public Sorting getSorting() { return sorting; }
+ public Dictionary getDictionary() { return dictionary; }
public void setRemoveIfZero(boolean remove) { this.removeIfZero = remove; }
public void setCreateIfNonExistent(boolean create) { this.createIfNonExistent = create; }
@@ -231,6 +234,7 @@ public final class Attribute implements Cloneable, Serializable {
public void setTensorType(TensorType tensorType) { this.tensorType = Optional.of(tensorType); }
public void setDistanceMetric(DistanceMetric metric) { this.distanceMetric = Optional.of(metric); }
public void setHnswIndexParams(HnswIndexParams params) { this.hnswIndexParams = Optional.of(params); }
+ public void setDictionary(Dictionary dictionary) { this.dictionary = dictionary; }
public String getName() { return name; }
public Type getType() { return type; }
@@ -348,7 +352,7 @@ public final class Attribute implements Cloneable, Serializable {
@Override
public int hashCode() {
return Objects.hash(
- name, type, collectionType, sorting, isPrefetch(), fastAccess, removeIfZero, createIfNonExistent,
+ name, type, collectionType, sorting, dictionary, isPrefetch(), fastAccess, removeIfZero, createIfNonExistent,
isPosition, huge, enableBitVectors, enableOnlyBitVector, tensorType, referenceDocumentType, distanceMetric, hnswIndexParams);
}
@@ -370,10 +374,10 @@ public final class Attribute implements Cloneable, Serializable {
if (this.createIfNonExistent != other.createIfNonExistent) return false;
if (this.enableBitVectors != other.enableBitVectors) return false;
if (this.enableOnlyBitVector != other.enableOnlyBitVector) return false;
- // if (this.noSearch != other.noSearch) return false; No backend consequences so compatible for now
if (this.fastSearch != other.fastSearch) return false;
if (this.huge != other.huge) return false;
if (! this.sorting.equals(other.sorting)) return false;
+ if (! Objects.equals(dictionary, other.dictionary)) return false;
if (! Objects.equals(tensorType, other.tensorType)) return false;
if (! Objects.equals(referenceDocumentType, other.referenceDocumentType)) return false;
if (! Objects.equals(distanceMetric, other.distanceMetric)) return false;
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/document/Dictionary.java b/config-model/src/main/java/com/yahoo/searchdefinition/document/Dictionary.java
new file mode 100644
index 00000000000..e492d572f27
--- /dev/null
+++ b/config-model/src/main/java/com/yahoo/searchdefinition/document/Dictionary.java
@@ -0,0 +1,16 @@
+// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
+package com.yahoo.searchdefinition.document;
+
+/**
+ * Represents settings for dictionary control
+ *
+ * @author baldersheim
+ */
+public class Dictionary {
+ public enum Type { BTREE, HASH, BTREE_AND_HASH };
+ private final Type type;
+ public Dictionary() { this(Type.BTREE); }
+ public Dictionary(Type type) { this.type = type; }
+ public Type getType() { return type; }
+}
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 d81394382c2..76b707fa19b 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
@@ -80,6 +80,8 @@ public class SDField extends Field implements TypedKey, FieldOperationContainer,
*/
private Matching matching = new Matching();
+ private Dictionary dictionary = null;
+
/** Attribute settings, or null if there are none */
private final Map<String, Attribute> attributes = new TreeMap<>();
@@ -533,6 +535,14 @@ public class SDField extends Field implements TypedKey, FieldOperationContainer,
public void setMatching(Matching matching) { this.matching=matching; }
/**
+ * Returns Dictionary settings.
+ */
+ public Dictionary getDictionary() { return dictionary; }
+
+
+ public void setDictionary(Dictionary dictionary) { this.dictionary=dictionary; }
+
+ /**
* Set the matching type for this field and all subfields.
*/
// TODO: When this is not the same as getMatching().setthis we have a potential for inconsistency. Find the right
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/fieldoperation/AttributeOperation.java b/config-model/src/main/java/com/yahoo/searchdefinition/fieldoperation/AttributeOperation.java
index b638932a4a8..56e241adb8e 100644
--- a/config-model/src/main/java/com/yahoo/searchdefinition/fieldoperation/AttributeOperation.java
+++ b/config-model/src/main/java/com/yahoo/searchdefinition/fieldoperation/AttributeOperation.java
@@ -90,10 +90,6 @@ public class AttributeOperation implements FieldOperation, FieldOperationContain
this.enableOnlyBitVector = enableOnlyBitVector;
}
- public boolean isDoAlias() {
- return doAlias;
- }
-
public void setDoAlias(boolean doAlias) {
this.doAlias = doAlias;
}
@@ -106,9 +102,6 @@ public class AttributeOperation implements FieldOperation, FieldOperationContain
this.alias = alias;
}
- public String getAliasedName() {
- return aliasedName;
- }
public void setAliasedName(String aliasedName) {
this.aliasedName = aliasedName;
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/fieldoperation/DictionaryOperation.java b/config-model/src/main/java/com/yahoo/searchdefinition/fieldoperation/DictionaryOperation.java
new file mode 100644
index 00000000000..ce7c5a71a21
--- /dev/null
+++ b/config-model/src/main/java/com/yahoo/searchdefinition/fieldoperation/DictionaryOperation.java
@@ -0,0 +1,35 @@
+// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
+package com.yahoo.searchdefinition.fieldoperation;
+
+import com.yahoo.searchdefinition.document.Dictionary;
+import com.yahoo.searchdefinition.document.SDField;
+
+/**
+ * Represents operations controlling setup of dictionary used for queries
+ *
+ * @author baldersheim
+ */
+public class DictionaryOperation implements FieldOperation {
+ private final Dictionary.Type type;
+
+ public DictionaryOperation(Dictionary.Type type) {
+ this.type = type;
+ }
+ @Override
+ public void apply(SDField field) {
+ Dictionary prev = field.getDictionary();
+ if (prev == null) {
+ field.setDictionary(new Dictionary(type));
+ } else if ((prev.getType() == Dictionary.Type.BTREE && type == Dictionary.Type.HASH) ||
+ (prev.getType() == Dictionary.Type.HASH && type == Dictionary.Type.BTREE))
+ {
+ field.setDictionary(new Dictionary(Dictionary.Type.BTREE_AND_HASH));
+ } else {
+ if (prev.getType() != type) {
+ throw new IllegalArgumentException("Can not combine previous dictionary setting " + prev.getType() +
+ " with current " + type);
+ }
+ }
+ }
+}
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/processing/DictionaryProcessor.java b/config-model/src/main/java/com/yahoo/searchdefinition/processing/DictionaryProcessor.java
new file mode 100644
index 00000000000..92ceb8e5e44
--- /dev/null
+++ b/config-model/src/main/java/com/yahoo/searchdefinition/processing/DictionaryProcessor.java
@@ -0,0 +1,41 @@
+// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+package com.yahoo.searchdefinition.processing;
+
+import com.yahoo.config.application.api.DeployLogger;
+import com.yahoo.document.NumericDataType;
+import com.yahoo.searchdefinition.RankProfileRegistry;
+import com.yahoo.searchdefinition.Search;
+import com.yahoo.searchdefinition.document.Attribute;
+import com.yahoo.searchdefinition.document.Dictionary;
+import com.yahoo.searchdefinition.document.SDField;
+import com.yahoo.vespa.model.container.search.QueryProfiles;
+
+/**
+ * Propagates dictionary settings from field level to attribute level.
+ * Only applies to numeric fields with fast-search enabled.
+ *
+ * @author baldersheim
+ */
+public class DictionaryProcessor extends Processor {
+ public DictionaryProcessor(Search search, DeployLogger deployLogger, RankProfileRegistry rankProfileRegistry, QueryProfiles queryProfiles) {
+ super(search, deployLogger, rankProfileRegistry, queryProfiles);
+ }
+ @Override
+ public void process(boolean validate, boolean documentsOnly) {
+ for (SDField field : search.allConcreteFields()) {
+ Dictionary dictionary = field.getDictionary();
+ if (dictionary == null) continue;
+
+ Attribute attribute = field.getAttribute();
+ if (attribute.getDataType() instanceof NumericDataType ) {
+ if (attribute.isFastSearch()) {
+ attribute.setDictionary(dictionary);
+ } else {
+ fail(search, field, "You must specify 'attribute:fast-search' to allow dictionary control");
+ }
+ } else {
+ fail(search, field, "You can only specify 'dictionary:' for numeric fields");
+ }
+ }
+ }
+}
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/processing/PredicateProcessor.java b/config-model/src/main/java/com/yahoo/searchdefinition/processing/PredicateProcessor.java
index 79f19efe422..ff0edcd0404 100644
--- a/config-model/src/main/java/com/yahoo/searchdefinition/processing/PredicateProcessor.java
+++ b/config-model/src/main/java/com/yahoo/searchdefinition/processing/PredicateProcessor.java
@@ -15,7 +15,13 @@ import com.yahoo.vespa.documentmodel.DocumentSummary;
import com.yahoo.vespa.documentmodel.SummaryField;
import com.yahoo.vespa.documentmodel.SummaryTransform;
import com.yahoo.vespa.indexinglanguage.ExpressionConverter;
-import com.yahoo.vespa.indexinglanguage.expressions.*;
+import com.yahoo.vespa.indexinglanguage.expressions.Expression;
+import com.yahoo.vespa.indexinglanguage.expressions.OptimizePredicateExpression;
+import com.yahoo.vespa.indexinglanguage.expressions.OutputExpression;
+import com.yahoo.vespa.indexinglanguage.expressions.ScriptExpression;
+import com.yahoo.vespa.indexinglanguage.expressions.SetValueExpression;
+import com.yahoo.vespa.indexinglanguage.expressions.SetVarExpression;
+import com.yahoo.vespa.indexinglanguage.expressions.StatementExpression;
import com.yahoo.vespa.model.container.search.QueryProfiles;
import java.util.ArrayList;
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/processing/Processing.java b/config-model/src/main/java/com/yahoo/searchdefinition/processing/Processing.java
index 1a3ef9e54b4..136d352ece7 100644
--- a/config-model/src/main/java/com/yahoo/searchdefinition/processing/Processing.java
+++ b/config-model/src/main/java/com/yahoo/searchdefinition/processing/Processing.java
@@ -37,6 +37,7 @@ public class Processing {
AttributesImplicitWord::new,
MutableAttributes::new,
CreatePositionZCurve::new,
+ DictionaryProcessor::new,
WordMatch::new,
ImportedFieldsResolver::new,
ImplicitSummaries::new,
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/processing/Processor.java b/config-model/src/main/java/com/yahoo/searchdefinition/processing/Processor.java
index 3744af7cc2c..61b5e6f2a64 100644
--- a/config-model/src/main/java/com/yahoo/searchdefinition/processing/Processor.java
+++ b/config-model/src/main/java/com/yahoo/searchdefinition/processing/Processor.java
@@ -25,7 +25,7 @@ import java.util.logging.Level;
public abstract class Processor {
protected final Search search;
- protected DeployLogger deployLogger;
+ protected final DeployLogger deployLogger;
protected final RankProfileRegistry rankProfileRegistry;
protected final QueryProfiles queryProfiles;
diff --git a/config-model/src/main/javacc/SDParser.jj b/config-model/src/main/javacc/SDParser.jj
index 869f671d8ef..2607b2fb02b 100644
--- a/config-model/src/main/javacc/SDParser.jj
+++ b/config-model/src/main/javacc/SDParser.jj
@@ -252,6 +252,7 @@ TOKEN :
| < PROPERTIES: "properties" >
| < ATTRIBUTE: "attribute" >
| < SORTING: "sorting" >
+| < DICTIONARY: "dictionary" >
| < ASCENDING: "ascending" >
| < DESCENDING: "descending" >
| < UCA: "uca" >
@@ -267,6 +268,8 @@ TOKEN :
| < IDENTICAL: "identical" >
| < STEMMING: "stemming" >
| < NORMALIZING: "normalizing" >
+| < HASH: "hash" >
+| < BTREE: "btree" >
| < BOLDING: "bolding" >
| < BODY: "body" >
| < HEADER: "header" >
@@ -987,6 +990,7 @@ String fieldBody(SDField field, Search search, SDDocumentType document) : { }
attribute(field) |
body(field) |
bolding(field) |
+ dictionary(field) |
fieldStemming(field) |
header(field) |
id(field, document) |
@@ -1520,6 +1524,34 @@ void bolding(FieldOperationContainer field) :
}
/**
+ * This rule consumes a dictionary statement of a field element.
+ *
+ * @param field The field to modify.
+ */
+void dictionary(FieldOperationContainer field) :
+{
+ Dictionary.Type type;
+}
+{
+ <DICTIONARY> <COLON> type = dictionaryType()
+ {
+ field.addOperation(new DictionaryOperation(type));
+ }
+}
+
+Dictionary.Type dictionaryType() :
+{
+ Dictionary.Type type;
+}
+{
+ ( <HASH> { type = Dictionary.Type.HASH; }
+ | <BTREE> { type = Dictionary.Type.BTREE; } )
+ {
+ return type;
+ }
+}
+
+/**
* This rule consumes a body statement of a field element.
*
* @param field The field to modify.
diff --git a/config-model/src/test/derived/advanced/attributes.cfg b/config-model/src/test/derived/advanced/attributes.cfg
index 0d4b3bc4ca7..641e2d8fde5 100644
--- a/config-model/src/test/derived/advanced/attributes.cfg
+++ b/config-model/src/test/derived/advanced/attributes.cfg
@@ -2,6 +2,7 @@ attribute[].name "location_zcurve"
attribute[].datatype INT64
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch true
diff --git a/config-model/src/test/derived/array_of_struct_attribute/attributes.cfg b/config-model/src/test/derived/array_of_struct_attribute/attributes.cfg
index dc269284e8f..bb4ba665406 100644
--- a/config-model/src/test/derived/array_of_struct_attribute/attributes.cfg
+++ b/config-model/src/test/derived/array_of_struct_attribute/attributes.cfg
@@ -2,6 +2,7 @@ attribute[].name "elem_array.name"
attribute[].datatype STRING
attribute[].collectiontype ARRAY
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch true
@@ -30,6 +31,7 @@ attribute[].name "elem_array.weight"
attribute[].datatype INT32
attribute[].collectiontype ARRAY
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
diff --git a/config-model/src/test/derived/attributeprefetch/attributes.cfg b/config-model/src/test/derived/attributeprefetch/attributes.cfg
index c43e38d0561..d05d2d1d5e0 100644
--- a/config-model/src/test/derived/attributeprefetch/attributes.cfg
+++ b/config-model/src/test/derived/attributeprefetch/attributes.cfg
@@ -2,6 +2,7 @@ attribute[].name "singlebyte"
attribute[].datatype INT8
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -30,6 +31,7 @@ attribute[].name "multibyte"
attribute[].datatype INT8
attribute[].collectiontype ARRAY
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -58,6 +60,7 @@ attribute[].name "wsbyte"
attribute[].datatype INT8
attribute[].collectiontype WEIGHTEDSET
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -86,6 +89,7 @@ attribute[].name "singleint"
attribute[].datatype INT32
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -114,6 +118,7 @@ attribute[].name "multiint"
attribute[].datatype INT32
attribute[].collectiontype ARRAY
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -142,6 +147,7 @@ attribute[].name "wsint"
attribute[].datatype INT32
attribute[].collectiontype WEIGHTEDSET
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -170,6 +176,7 @@ attribute[].name "singlelong"
attribute[].datatype INT64
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -198,6 +205,7 @@ attribute[].name "multilong"
attribute[].datatype INT64
attribute[].collectiontype ARRAY
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -226,6 +234,7 @@ attribute[].name "wslong"
attribute[].datatype INT64
attribute[].collectiontype WEIGHTEDSET
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -254,6 +263,7 @@ attribute[].name "singlefloat"
attribute[].datatype FLOAT
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -282,6 +292,7 @@ attribute[].name "multifloat"
attribute[].datatype FLOAT
attribute[].collectiontype ARRAY
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -310,6 +321,7 @@ attribute[].name "wsfloat"
attribute[].datatype FLOAT
attribute[].collectiontype WEIGHTEDSET
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -338,6 +350,7 @@ attribute[].name "singledouble"
attribute[].datatype DOUBLE
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -366,6 +379,7 @@ attribute[].name "multidouble"
attribute[].datatype DOUBLE
attribute[].collectiontype ARRAY
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -394,6 +408,7 @@ attribute[].name "wsdouble"
attribute[].datatype DOUBLE
attribute[].collectiontype WEIGHTEDSET
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -422,6 +437,7 @@ attribute[].name "singlestring"
attribute[].datatype STRING
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -450,6 +466,7 @@ attribute[].name "multistring"
attribute[].datatype STRING
attribute[].collectiontype ARRAY
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -478,6 +495,7 @@ attribute[].name "wsstring"
attribute[].datatype STRING
attribute[].collectiontype WEIGHTEDSET
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
diff --git a/config-model/src/test/derived/attributes/attributes.cfg b/config-model/src/test/derived/attributes/attributes.cfg
index 4ecb0c2af8f..e9f3f68adc1 100644
--- a/config-model/src/test/derived/attributes/attributes.cfg
+++ b/config-model/src/test/derived/attributes/attributes.cfg
@@ -2,6 +2,7 @@ attribute[].name "a1"
attribute[].datatype STRING
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -30,6 +31,7 @@ attribute[].name "a2"
attribute[].datatype STRING
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -58,6 +60,7 @@ attribute[].name "a3"
attribute[].datatype STRING
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -86,6 +89,7 @@ attribute[].name "a5"
attribute[].datatype STRING
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -114,6 +118,7 @@ attribute[].name "a6"
attribute[].datatype STRING
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -142,6 +147,7 @@ attribute[].name "b1"
attribute[].datatype STRING
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -170,6 +176,7 @@ attribute[].name "b2"
attribute[].datatype STRING
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -198,6 +205,7 @@ attribute[].name "b3"
attribute[].datatype STRING
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -226,6 +234,7 @@ attribute[].name "b4"
attribute[].datatype INT32
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -254,6 +263,7 @@ attribute[].name "b5"
attribute[].datatype INT32
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -282,6 +292,7 @@ attribute[].name "b6"
attribute[].datatype INT64
attribute[].collectiontype ARRAY
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -310,6 +321,7 @@ attribute[].name "b7"
attribute[].datatype DOUBLE
attribute[].collectiontype WEIGHTEDSET
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -338,6 +350,7 @@ attribute[].name "a9"
attribute[].datatype INT32
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -366,6 +379,7 @@ attribute[].name "a10"
attribute[].datatype INT32
attribute[].collectiontype ARRAY
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch true
@@ -394,6 +408,7 @@ attribute[].name "a11"
attribute[].datatype INT32
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -422,6 +437,7 @@ attribute[].name "a12"
attribute[].datatype INT32
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -450,6 +466,7 @@ attribute[].name "a7_arr"
attribute[].datatype STRING
attribute[].collectiontype ARRAY
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -478,6 +495,7 @@ attribute[].name "a8_arr"
attribute[].datatype STRING
attribute[].collectiontype ARRAY
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
diff --git a/config-model/src/test/derived/complex/attributes.cfg b/config-model/src/test/derived/complex/attributes.cfg
index fe6f42e55bc..622fb9f349c 100644
--- a/config-model/src/test/derived/complex/attributes.cfg
+++ b/config-model/src/test/derived/complex/attributes.cfg
@@ -2,6 +2,7 @@ attribute[].name "prefixenabled"
attribute[].datatype STRING
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -30,6 +31,7 @@ attribute[].name "fleeting"
attribute[].datatype FLOAT
attribute[].collectiontype ARRAY
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -58,6 +60,7 @@ attribute[].name "fleeting2"
attribute[].datatype FLOAT
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -86,6 +89,7 @@ attribute[].name "foundat"
attribute[].datatype INT64
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -114,6 +118,7 @@ attribute[].name "collapseby"
attribute[].datatype INT32
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -142,6 +147,7 @@ attribute[].name "ts"
attribute[].datatype INT64
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -170,6 +176,7 @@ attribute[].name "combineda"
attribute[].datatype INT32
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -198,6 +205,7 @@ attribute[].name "year_arr"
attribute[].datatype INT32
attribute[].collectiontype ARRAY
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -226,6 +234,7 @@ attribute[].name "year_sub"
attribute[].datatype INT32
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
diff --git a/config-model/src/test/derived/hnsw_index/attributes.cfg b/config-model/src/test/derived/hnsw_index/attributes.cfg
index 53eb98b6ba8..4d275787bfd 100644
--- a/config-model/src/test/derived/hnsw_index/attributes.cfg
+++ b/config-model/src/test/derived/hnsw_index/attributes.cfg
@@ -2,6 +2,7 @@ attribute[].name "t1"
attribute[].datatype TENSOR
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -30,6 +31,7 @@ attribute[].name "t2"
attribute[].datatype TENSOR
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
diff --git a/config-model/src/test/derived/imported_fields_inherited_reference/attributes.cfg b/config-model/src/test/derived/imported_fields_inherited_reference/attributes.cfg
index 2c209db96f2..bfdf90ac12c 100644
--- a/config-model/src/test/derived/imported_fields_inherited_reference/attributes.cfg
+++ b/config-model/src/test/derived/imported_fields_inherited_reference/attributes.cfg
@@ -2,6 +2,7 @@ attribute[].name "ref_from_a"
attribute[].datatype REFERENCE
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -30,6 +31,7 @@ attribute[].name "ref_from_b"
attribute[].datatype REFERENCE
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -58,6 +60,7 @@ attribute[].name "from_a_int_field"
attribute[].datatype INT32
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -86,6 +89,7 @@ attribute[].name "from_b_int_field"
attribute[].datatype INT32
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
diff --git a/config-model/src/test/derived/imported_position_field/attributes.cfg b/config-model/src/test/derived/imported_position_field/attributes.cfg
index 5bb0d9bfef3..f1b20c6e454 100644
--- a/config-model/src/test/derived/imported_position_field/attributes.cfg
+++ b/config-model/src/test/derived/imported_position_field/attributes.cfg
@@ -2,6 +2,7 @@ attribute[].name "parent_ref"
attribute[].datatype REFERENCE
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -30,6 +31,7 @@ attribute[].name "my_pos_zcurve"
attribute[].datatype INT64
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch true
diff --git a/config-model/src/test/derived/imported_struct_fields/attributes.cfg b/config-model/src/test/derived/imported_struct_fields/attributes.cfg
index f299756efb1..9e0b5f18170 100644
--- a/config-model/src/test/derived/imported_struct_fields/attributes.cfg
+++ b/config-model/src/test/derived/imported_struct_fields/attributes.cfg
@@ -2,6 +2,7 @@ attribute[].name "parent_ref"
attribute[].datatype REFERENCE
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -30,6 +31,7 @@ attribute[].name "my_elem_array.name"
attribute[].datatype STRING
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch true
@@ -58,6 +60,7 @@ attribute[].name "my_elem_array.weight"
attribute[].datatype INT32
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -86,6 +89,7 @@ attribute[].name "my_elem_map.key"
attribute[].datatype STRING
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch true
@@ -114,6 +118,7 @@ attribute[].name "my_elem_map.value.name"
attribute[].datatype STRING
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch true
@@ -142,6 +147,7 @@ attribute[].name "my_elem_map.value.weight"
attribute[].datatype INT32
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -170,6 +176,7 @@ attribute[].name "my_str_int_map.key"
attribute[].datatype STRING
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch true
@@ -198,6 +205,7 @@ attribute[].name "my_str_int_map.value"
attribute[].datatype INT32
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
diff --git a/config-model/src/test/derived/importedfields/attributes.cfg b/config-model/src/test/derived/importedfields/attributes.cfg
index 680d6571939..68cd917336f 100644
--- a/config-model/src/test/derived/importedfields/attributes.cfg
+++ b/config-model/src/test/derived/importedfields/attributes.cfg
@@ -2,6 +2,7 @@ attribute[].name "a_ref"
attribute[].datatype REFERENCE
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -30,6 +31,7 @@ attribute[].name "b_ref"
attribute[].datatype REFERENCE
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -58,6 +60,7 @@ attribute[].name "b_ref_with_summary"
attribute[].datatype REFERENCE
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -86,6 +89,7 @@ attribute[].name "my_int_field"
attribute[].datatype INT32
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -114,6 +118,7 @@ attribute[].name "my_string_field"
attribute[].datatype STRING
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -142,6 +147,7 @@ attribute[].name "my_int_array_field"
attribute[].datatype INT32
attribute[].collectiontype ARRAY
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -170,6 +176,7 @@ attribute[].name "my_int_wset_field"
attribute[].datatype INT32
attribute[].collectiontype WEIGHTEDSET
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -198,6 +205,7 @@ attribute[].name "my_ancient_int_field"
attribute[].datatype INT32
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
diff --git a/config-model/src/test/derived/inheritance/attributes.cfg b/config-model/src/test/derived/inheritance/attributes.cfg
index 52367a04a30..a931af7af4d 100644
--- a/config-model/src/test/derived/inheritance/attributes.cfg
+++ b/config-model/src/test/derived/inheritance/attributes.cfg
@@ -2,6 +2,7 @@ attribute[].name "onlygrandparent"
attribute[].datatype INT32
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -30,6 +31,7 @@ attribute[].name "overridden"
attribute[].datatype INT32
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -58,6 +60,7 @@ attribute[].name "onlymother"
attribute[].datatype STRING
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
diff --git a/config-model/src/test/derived/inheritfromparent/attributes.cfg b/config-model/src/test/derived/inheritfromparent/attributes.cfg
index b25a46dc433..11498de54b1 100644
--- a/config-model/src/test/derived/inheritfromparent/attributes.cfg
+++ b/config-model/src/test/derived/inheritfromparent/attributes.cfg
@@ -2,6 +2,7 @@ attribute[].name "weight"
attribute[].datatype FLOAT
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
diff --git a/config-model/src/test/derived/map_attribute/attributes.cfg b/config-model/src/test/derived/map_attribute/attributes.cfg
index d9624e89500..acbdf119d0d 100644
--- a/config-model/src/test/derived/map_attribute/attributes.cfg
+++ b/config-model/src/test/derived/map_attribute/attributes.cfg
@@ -2,6 +2,7 @@ attribute[].name "str_map.key"
attribute[].datatype STRING
attribute[].collectiontype ARRAY
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch true
@@ -30,6 +31,7 @@ attribute[].name "str_map.value"
attribute[].datatype STRING
attribute[].collectiontype ARRAY
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -58,6 +60,7 @@ attribute[].name "int_map.key"
attribute[].datatype INT32
attribute[].collectiontype ARRAY
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
diff --git a/config-model/src/test/derived/map_of_struct_attribute/attributes.cfg b/config-model/src/test/derived/map_of_struct_attribute/attributes.cfg
index 5fd10269ceb..ecc8c2fd69d 100644
--- a/config-model/src/test/derived/map_of_struct_attribute/attributes.cfg
+++ b/config-model/src/test/derived/map_of_struct_attribute/attributes.cfg
@@ -2,6 +2,7 @@ attribute[].name "str_elem_map.key"
attribute[].datatype STRING
attribute[].collectiontype ARRAY
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch true
@@ -30,6 +31,7 @@ attribute[].name "str_elem_map.value.name"
attribute[].datatype STRING
attribute[].collectiontype ARRAY
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -58,6 +60,7 @@ attribute[].name "str_elem_map.value.weight"
attribute[].datatype INT32
attribute[].collectiontype ARRAY
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -86,6 +89,7 @@ attribute[].name "int_elem_map.key"
attribute[].datatype INT32
attribute[].collectiontype ARRAY
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -114,6 +118,7 @@ attribute[].name "int_elem_map.value.name"
attribute[].datatype STRING
attribute[].collectiontype ARRAY
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch true
diff --git a/config-model/src/test/derived/music/attributes.cfg b/config-model/src/test/derived/music/attributes.cfg
index ebb8eb10c14..a31325e67d0 100644
--- a/config-model/src/test/derived/music/attributes.cfg
+++ b/config-model/src/test/derived/music/attributes.cfg
@@ -2,6 +2,7 @@ attribute[].name "sales"
attribute[].datatype INT32
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -30,6 +31,7 @@ attribute[].name "pto"
attribute[].datatype INT32
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -58,6 +60,7 @@ attribute[].name "mid"
attribute[].datatype INT32
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -86,6 +89,7 @@ attribute[].name "weight"
attribute[].datatype FLOAT
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -114,6 +118,7 @@ attribute[].name "bgnpfrom"
attribute[].datatype FLOAT
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -142,6 +147,7 @@ attribute[].name "newestedition"
attribute[].datatype INT32
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -170,6 +176,7 @@ attribute[].name "year"
attribute[].datatype INT32
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -198,6 +205,7 @@ attribute[].name "did"
attribute[].datatype INT32
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -226,6 +234,7 @@ attribute[].name "cbid"
attribute[].datatype INT32
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -254,6 +263,7 @@ attribute[].name "hiphopvalue_arr"
attribute[].datatype STRING
attribute[].collectiontype ARRAY
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -282,6 +292,7 @@ attribute[].name "metalvalue_arr"
attribute[].datatype STRING
attribute[].collectiontype ARRAY
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
diff --git a/config-model/src/test/derived/newrank/attributes.cfg b/config-model/src/test/derived/newrank/attributes.cfg
index 5f5e7e62d83..68f24871f02 100644
--- a/config-model/src/test/derived/newrank/attributes.cfg
+++ b/config-model/src/test/derived/newrank/attributes.cfg
@@ -2,6 +2,7 @@ attribute[].name "sales"
attribute[].datatype INT32
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -30,6 +31,7 @@ attribute[].name "pto"
attribute[].datatype INT32
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -58,6 +60,7 @@ attribute[].name "mid"
attribute[].datatype INT32
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -86,6 +89,7 @@ attribute[].name "weight"
attribute[].datatype FLOAT
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -114,6 +118,7 @@ attribute[].name "bgnpfrom"
attribute[].datatype FLOAT
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -142,6 +147,7 @@ attribute[].name "newestedition"
attribute[].datatype INT32
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -170,6 +176,7 @@ attribute[].name "year"
attribute[].datatype INT32
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -198,6 +205,7 @@ attribute[].name "did"
attribute[].datatype INT32
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -226,6 +234,7 @@ attribute[].name "scorekey"
attribute[].datatype INT32
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -254,6 +263,7 @@ attribute[].name "cbid"
attribute[].datatype INT32
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
diff --git a/config-model/src/test/derived/predicate_attribute/attributes.cfg b/config-model/src/test/derived/predicate_attribute/attributes.cfg
index 6a7ff8af7ad..ff45cf1a41e 100644
--- a/config-model/src/test/derived/predicate_attribute/attributes.cfg
+++ b/config-model/src/test/derived/predicate_attribute/attributes.cfg
@@ -2,6 +2,7 @@ attribute[].name "some_predicate_field"
attribute[].datatype PREDICATE
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
diff --git a/config-model/src/test/derived/prefixexactattribute/attributes.cfg b/config-model/src/test/derived/prefixexactattribute/attributes.cfg
index 2a5fc890f9e..f9878068372 100644
--- a/config-model/src/test/derived/prefixexactattribute/attributes.cfg
+++ b/config-model/src/test/derived/prefixexactattribute/attributes.cfg
@@ -2,6 +2,7 @@ attribute[].name "attributefield1"
attribute[].datatype STRING
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -30,6 +31,7 @@ attribute[].name "attributefield2"
attribute[].datatype STRING
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
diff --git a/config-model/src/test/derived/reference_fields/attributes.cfg b/config-model/src/test/derived/reference_fields/attributes.cfg
index 3ecd24d50dc..ad3ff5e62f8 100644
--- a/config-model/src/test/derived/reference_fields/attributes.cfg
+++ b/config-model/src/test/derived/reference_fields/attributes.cfg
@@ -2,6 +2,7 @@ attribute[].name "campaign_ref"
attribute[].datatype REFERENCE
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -30,6 +31,7 @@ attribute[].name "other_ref"
attribute[].datatype REFERENCE
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -58,6 +60,7 @@ attribute[].name "yet_another_ref"
attribute[].datatype REFERENCE
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
diff --git a/config-model/src/test/derived/sorting/attributes.cfg b/config-model/src/test/derived/sorting/attributes.cfg
index a84c7780965..ebe0e83540e 100644
--- a/config-model/src/test/derived/sorting/attributes.cfg
+++ b/config-model/src/test/derived/sorting/attributes.cfg
@@ -2,6 +2,7 @@ attribute[].name "syntaxcheck"
attribute[].datatype STRING
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -30,6 +31,7 @@ attribute[].name "syntaxcheck2"
attribute[].datatype STRING
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -58,6 +60,7 @@ attribute[].name "infieldonly"
attribute[].datatype STRING
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
diff --git a/config-model/src/test/derived/tensor/attributes.cfg b/config-model/src/test/derived/tensor/attributes.cfg
index cc28f1b6f84..398cdf5f8f8 100644
--- a/config-model/src/test/derived/tensor/attributes.cfg
+++ b/config-model/src/test/derived/tensor/attributes.cfg
@@ -2,6 +2,7 @@ attribute[].name "f2"
attribute[].datatype TENSOR
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -30,6 +31,7 @@ attribute[].name "f3"
attribute[].datatype TENSOR
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -58,6 +60,7 @@ attribute[].name "f4"
attribute[].datatype TENSOR
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -86,6 +89,7 @@ attribute[].name "f5"
attribute[].datatype TENSOR
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -114,6 +118,7 @@ attribute[].name "f6"
attribute[].datatype FLOAT
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
diff --git a/config-model/src/test/derived/types/attributes.cfg b/config-model/src/test/derived/types/attributes.cfg
index d30c79efbc2..05e19a15d96 100644
--- a/config-model/src/test/derived/types/attributes.cfg
+++ b/config-model/src/test/derived/types/attributes.cfg
@@ -2,6 +2,7 @@ attribute[].name "abyte"
attribute[].datatype INT8
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -30,6 +31,7 @@ attribute[].name "along"
attribute[].datatype INT64
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -58,6 +60,7 @@ attribute[].name "abool"
attribute[].datatype BOOL
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -86,6 +89,7 @@ attribute[].name "ashortfloat"
attribute[].datatype FLOAT16
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -114,6 +118,7 @@ attribute[].name "arrayfield"
attribute[].datatype INT32
attribute[].collectiontype ARRAY
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -142,6 +147,7 @@ attribute[].name "setfield"
attribute[].datatype STRING
attribute[].collectiontype WEIGHTEDSET
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -170,6 +176,7 @@ attribute[].name "setfield2"
attribute[].datatype STRING
attribute[].collectiontype WEIGHTEDSET
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero true
attribute[].createifnonexistent true
attribute[].fastsearch false
@@ -198,6 +205,7 @@ attribute[].name "setfield3"
attribute[].datatype STRING
attribute[].collectiontype WEIGHTEDSET
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero true
attribute[].createifnonexistent false
attribute[].fastsearch false
@@ -226,6 +234,7 @@ attribute[].name "setfield4"
attribute[].datatype STRING
attribute[].collectiontype WEIGHTEDSET
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent true
attribute[].fastsearch false
@@ -254,6 +263,7 @@ attribute[].name "tagfield"
attribute[].datatype STRING
attribute[].collectiontype WEIGHTEDSET
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero true
attribute[].createifnonexistent true
attribute[].fastsearch false
@@ -282,6 +292,7 @@ attribute[].name "juletre"
attribute[].datatype INT64
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch true
@@ -310,6 +321,7 @@ attribute[].name "album1"
attribute[].datatype STRING
attribute[].collectiontype WEIGHTEDSET
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero true
attribute[].createifnonexistent true
attribute[].fastsearch false
@@ -338,6 +350,7 @@ attribute[].name "other"
attribute[].datatype INT64
attribute[].collectiontype SINGLE
attribute[].dictionary.ordering ORDERED
+attribute[].dictionary.type BTREE
attribute[].removeifzero false
attribute[].createifnonexistent false
attribute[].fastsearch false
diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/BoldingTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/BoldingTestCase.java
index 911f8e797e1..5589ad018a7 100644
--- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/BoldingTestCase.java
+++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/BoldingTestCase.java
@@ -1,4 +1,4 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.searchdefinition.processing;
import com.yahoo.searchdefinition.SearchBuilder;
diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/DictionaryTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/DictionaryTestCase.java
new file mode 100644
index 00000000000..256858b372e
--- /dev/null
+++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/DictionaryTestCase.java
@@ -0,0 +1,125 @@
+// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
+package com.yahoo.searchdefinition.processing;
+
+import com.yahoo.config.model.test.TestUtil;
+import com.yahoo.searchdefinition.Search;
+import com.yahoo.searchdefinition.SearchBuilder;
+import com.yahoo.searchdefinition.derived.AttributeFields;
+import com.yahoo.searchdefinition.document.Dictionary;
+import com.yahoo.searchdefinition.parser.ParseException;
+import com.yahoo.vespa.config.search.AttributesConfig;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+/**
+ * Test configuration of dictionary control.
+ *
+ * @author baldersheim
+ */
+public class DictionaryTestCase {
+ private static AttributesConfig getConfig(Search search) {
+ AttributeFields attributes = new AttributeFields(search);
+ AttributesConfig.Builder builder = new AttributesConfig.Builder();
+ attributes.getConfig(builder);
+ return builder.build();
+ }
+ private Search createSearch(String def) throws ParseException {
+ SearchBuilder sb = SearchBuilder.createFromString(def);
+ return sb.getSearch();
+ }
+ @Test
+ public void testDefaultDictionarySettings() throws ParseException {
+ String def = TestUtil.joinLines(
+ "search test {",
+ " document test {",
+ " field s1 type string {",
+ " indexing: attribute | summary",
+ " }",
+ " field n1 type int {",
+ " indexing: summary | attribute",
+ " }",
+ " }",
+ "}");
+ Search search = createSearch(def);
+ assertEquals(Dictionary.Type.BTREE, search.getAttribute("s1").getDictionary().getType());
+ assertEquals(Dictionary.Type.BTREE, search.getAttribute("n1").getDictionary().getType());
+ }
+
+ void verifyNumericDictionaryControl(Dictionary.Type expected,
+ AttributesConfig.Attribute.Dictionary.Type.Enum expectedConfig,
+ String ... cfg) throws ParseException
+ {
+ String def = TestUtil.joinLines(
+ "search test {",
+ " document test {",
+ " field n1 type int {",
+ " indexing: summary | attribute",
+ " attribute:fast-search",
+ TestUtil.joinLines(cfg),
+ " }",
+ " }",
+ "}");
+ Search search = createSearch(def);
+ assertEquals(expected, search.getAttribute("n1").getDictionary().getType());
+ assertEquals(expectedConfig,
+ getConfig(search).attribute().get(0).dictionary().type());
+ }
+
+ @Test
+ public void testNumericBtreeSettings() throws ParseException {
+ verifyNumericDictionaryControl(Dictionary.Type.BTREE,
+ AttributesConfig.Attribute.Dictionary.Type.BTREE,
+ "dictionary:btree");
+ }
+ @Test
+ public void testNumericHashSettings() throws ParseException {
+ verifyNumericDictionaryControl(Dictionary.Type.HASH,
+ AttributesConfig.Attribute.Dictionary.Type.HASH,
+ "dictionary:hash");
+ }
+ @Test
+ public void testNumericBtreeAndHashSettings() throws ParseException {
+ verifyNumericDictionaryControl(Dictionary.Type.BTREE_AND_HASH,
+ AttributesConfig.Attribute.Dictionary.Type.BTREE_AND_HASH,
+ "dictionary:btree", "dictionary:hash");
+ }
+ @Test
+ public void testNonNumericFieldsFailsDictionaryControl() throws ParseException {
+ String def =
+ "search test {\n" +
+ " document test {\n" +
+ " field n1 type string {\n" +
+ " indexing: summary | attribute\n" +
+ " dictionary:btree\n" +
+ " }\n" +
+ " }\n" +
+ "}\n";
+ try {
+ SearchBuilder sb = SearchBuilder.createFromString(def);
+ fail("Controlling dictionary for non-numeric fields are not yet supported.");
+ } catch (IllegalArgumentException e) {
+ assertEquals("For search 'test', field 'n1': You can only specify 'dictionary:' for numeric fields", e.getMessage());
+ }
+ }
+ @Test
+ public void testNonFastSearchFieldsFailsDictionaryControl() throws ParseException {
+ String def =
+ "search test {\n" +
+ " document test {\n" +
+ " field n1 type int {\n" +
+ " indexing: summary | attribute\n" +
+ " dictionary:btree\n" +
+ " }\n" +
+ " }\n" +
+ "}\n";
+ try {
+ SearchBuilder sb = SearchBuilder.createFromString(def);
+ fail("Controlling dictionary for non-fast-search fields are not allowed.");
+ } catch (IllegalArgumentException e) {
+ assertEquals("For search 'test', field 'n1': You must specify 'attribute:fast-search' to allow dictionary control", e.getMessage());
+ }
+ }
+}