summaryrefslogtreecommitdiffstats
path: root/config-model/src/test
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2024-01-11 11:57:09 +0100
committerGitHub <noreply@github.com>2024-01-11 11:57:09 +0100
commitc35da2bfe42797997cff3c6d42c491c5566698e7 (patch)
tree082dcddbd291840c0ec07b7a4e9065e0d91f98f8 /config-model/src/test
parent04d491286aa2a6f8b3a04048936419c6cde4e3ec (diff)
parent1a7e8a2eb5135d3cc04820770ced9aaa51374f89 (diff)
Merge pull request #29844 from vespa-engine/balder/handle-cased-streaming-search
Balder/handle cased streaming search
Diffstat (limited to 'config-model/src/test')
-rw-r--r--config-model/src/test/derived/indexschema/vsmfields.cfg24
-rw-r--r--config-model/src/test/derived/nearestneighbor_streaming/vsmfields.cfg4
-rw-r--r--config-model/src/test/derived/prefixexactattribute/vsmfields.cfg5
-rw-r--r--config-model/src/test/derived/streamingstruct/vsmfields.cfg56
-rw-r--r--config-model/src/test/java/com/yahoo/schema/derived/VsmFieldsTestCase.java49
5 files changed, 131 insertions, 7 deletions
diff --git a/config-model/src/test/derived/indexschema/vsmfields.cfg b/config-model/src/test/derived/indexschema/vsmfields.cfg
index 31db622183e..a2152f9787f 100644
--- a/config-model/src/test/derived/indexschema/vsmfields.cfg
+++ b/config-model/src/test/derived/indexschema/vsmfields.cfg
@@ -3,121 +3,145 @@ searchall 1
fieldspec[].name "sa"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "sb"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "sc"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "sd"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "pos"
fieldspec[].searchmethod GEOPOS
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "se"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 "word"
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype ATTRIBUTE
fieldspec[].name "sf"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "sg"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "sh"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "si"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "exact1"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 "exact"
+fieldspec[].normalize LOWERCASE
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "exact2"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 "exact"
+fieldspec[].normalize LOWERCASE
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "bm25_field"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "ia"
fieldspec[].searchmethod INT32
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype ATTRIBUTE
fieldspec[].name "ib"
fieldspec[].searchmethod INT32
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype ATTRIBUTE
fieldspec[].name "ic"
fieldspec[].searchmethod INT32
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype ATTRIBUTE
fieldspec[].name "nostemstring1"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "nostemstring2"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "nostemstring3"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "nostemstring4"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "fs9"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "f10.text"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "sd_literal"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "pos_zcurve"
fieldspec[].searchmethod INT64
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype ATTRIBUTE
documenttype[].name "indexschema"
diff --git a/config-model/src/test/derived/nearestneighbor_streaming/vsmfields.cfg b/config-model/src/test/derived/nearestneighbor_streaming/vsmfields.cfg
index f8b1cf62048..ec06d01f05a 100644
--- a/config-model/src/test/derived/nearestneighbor_streaming/vsmfields.cfg
+++ b/config-model/src/test/derived/nearestneighbor_streaming/vsmfields.cfg
@@ -3,21 +3,25 @@ searchall 1
fieldspec[].name "vec_a"
fieldspec[].searchmethod NEAREST_NEIGHBOR
fieldspec[].arg1 "EUCLIDEAN"
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype ATTRIBUTE
fieldspec[].name "vec_b"
fieldspec[].searchmethod NEAREST_NEIGHBOR
fieldspec[].arg1 "ANGULAR"
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype ATTRIBUTE
fieldspec[].name "vec_c"
fieldspec[].searchmethod NEAREST_NEIGHBOR
fieldspec[].arg1 "INNERPRODUCT"
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype ATTRIBUTE
fieldspec[].name "vec_d"
fieldspec[].searchmethod NONE
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype ATTRIBUTE
documenttype[].name "test"
diff --git a/config-model/src/test/derived/prefixexactattribute/vsmfields.cfg b/config-model/src/test/derived/prefixexactattribute/vsmfields.cfg
index 29bcde9faad..75192ef3121 100644
--- a/config-model/src/test/derived/prefixexactattribute/vsmfields.cfg
+++ b/config-model/src/test/derived/prefixexactattribute/vsmfields.cfg
@@ -3,26 +3,31 @@ searchall 1
fieldspec[].name "indexfield0"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 "prefix"
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 79
fieldspec[].fieldtype INDEX
fieldspec[].name "attributefield1"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 "exact"
+fieldspec[].normalize LOWERCASE
fieldspec[].maxlength 1048576
fieldspec[].fieldtype ATTRIBUTE
fieldspec[].name "attributefield2"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 "exact"
+fieldspec[].normalize LOWERCASE
fieldspec[].maxlength 1048576
fieldspec[].fieldtype ATTRIBUTE
fieldspec[].name "indexfield1"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 "exact"
+fieldspec[].normalize LOWERCASE
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "indexfield2"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 "exact"
+fieldspec[].normalize LOWERCASE
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
documenttype[].name "prefixexactattribute"
diff --git a/config-model/src/test/derived/streamingstruct/vsmfields.cfg b/config-model/src/test/derived/streamingstruct/vsmfields.cfg
index 7178f9d41ea..b5a234e8095 100644
--- a/config-model/src/test/derived/streamingstruct/vsmfields.cfg
+++ b/config-model/src/test/derived/streamingstruct/vsmfields.cfg
@@ -3,281 +3,337 @@ searchall 1
fieldspec[].name "coupleof"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "normalfields"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "a.f1"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "a.f1s"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 "substring"
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "a.f2"
fieldspec[].searchmethod INT32
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "a.f3"
fieldspec[].searchmethod DOUBLE
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "m.key"
fieldspec[].searchmethod INT64
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "m.value"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "b.f1"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "b.f1s"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 "substring"
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "b.f2"
fieldspec[].searchmethod INT32
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "b.f3"
fieldspec[].searchmethod DOUBLE
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "c.f1"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 "word"
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype ATTRIBUTE
fieldspec[].name "c.f1s"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 "prefix"
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "c.f3"
fieldspec[].searchmethod DOUBLE
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "c2.f1"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 "word"
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype ATTRIBUTE
fieldspec[].name "c2.f1s"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 "suffix"
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "c2.f2"
fieldspec[].searchmethod INT32
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "c2.f3"
fieldspec[].searchmethod DOUBLE
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "c3.f1"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 "word"
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype ATTRIBUTE
fieldspec[].name "c3.f1s"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 "prefix"
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "c3.f2"
fieldspec[].searchmethod INT32
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "c3.f3"
fieldspec[].searchmethod DOUBLE
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "n.nf1.f1"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "n.nf1.f1s"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 "prefix"
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "n.nf1.f3"
fieldspec[].searchmethod DOUBLE
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "n.nf1s.f1"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 "substring"
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "n.nf1s.f1s"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 "substring"
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "n.nf1s.f2"
fieldspec[].searchmethod INT32
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "n.nf1s.f3"
fieldspec[].searchmethod DOUBLE
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "n.nf2"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "array1.f1"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "array1.f1s"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 "substring"
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "array1.f2"
fieldspec[].searchmethod INT32
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "array1.f3"
fieldspec[].searchmethod DOUBLE
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "array2.f1"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "array2.f1s"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 "substring"
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "array2.f2"
fieldspec[].searchmethod INT32
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "array2.f3"
fieldspec[].searchmethod DOUBLE
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "array3.f1"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 "word"
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype ATTRIBUTE
fieldspec[].name "array3.f1s"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 "prefix"
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "array3.f3"
fieldspec[].searchmethod DOUBLE
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "subject.f1"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "d.f1"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 "prefix"
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "d.f1s"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 "prefix"
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "d.f2"
fieldspec[].searchmethod INT32
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "d.f3"
fieldspec[].searchmethod DOUBLE
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "e.f1"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 "substring"
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "e.f1s"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 "substring"
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "e.f2"
fieldspec[].searchmethod INT32
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "e.f3"
fieldspec[].searchmethod DOUBLE
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "f.f1"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 "suffix"
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "f.f1s"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 "suffix"
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "f.f2"
fieldspec[].searchmethod INT32
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "f.f3"
fieldspec[].searchmethod DOUBLE
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
fieldspec[].name "g"
fieldspec[].searchmethod AUTOUTF8
fieldspec[].arg1 ""
+fieldspec[].normalize LOWERCASE_AND_FOLD
fieldspec[].maxlength 1048576
fieldspec[].fieldtype INDEX
documenttype[].name "streamingstruct"
diff --git a/config-model/src/test/java/com/yahoo/schema/derived/VsmFieldsTestCase.java b/config-model/src/test/java/com/yahoo/schema/derived/VsmFieldsTestCase.java
index 6423b621ab9..601c014bdc1 100644
--- a/config-model/src/test/java/com/yahoo/schema/derived/VsmFieldsTestCase.java
+++ b/config-model/src/test/java/com/yahoo/schema/derived/VsmFieldsTestCase.java
@@ -4,8 +4,12 @@ package com.yahoo.schema.derived;
import com.yahoo.config.model.application.provider.MockFileRegistry;
import com.yahoo.config.model.deploy.TestProperties;
import com.yahoo.config.model.test.MockApplicationPackage;
+import com.yahoo.document.DataType;
import com.yahoo.documentmodel.NewDocumentReferenceDataType;
import com.yahoo.schema.Schema;
+import com.yahoo.schema.document.Case;
+import com.yahoo.schema.document.MatchType;
+import com.yahoo.schema.document.Matching;
import com.yahoo.schema.document.SDDocumentType;
import com.yahoo.schema.document.SDField;
import com.yahoo.schema.document.TemporarySDField;
@@ -19,24 +23,55 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
*/
public class VsmFieldsTestCase {
- @SuppressWarnings("deprecation")
- @Test
- void reference_type_field_is_unsearchable() {
+ private static Schema createSchema() {
Schema schema = new Schema("test", MockApplicationPackage.createEmpty(), new MockFileRegistry(), new TestableDeployLogger(), new TestProperties());
var sdoc = new SDDocumentType("test");
schema.addDocument(sdoc);
- SDField refField = new TemporarySDField(sdoc, "ref_field", NewDocumentReferenceDataType.forDocumentName("parent_type"));
- refField.parseIndexingScript("{ summary }");
- schema.getDocument().addField(refField);
+ return schema;
+ }
+ private static VsmfieldsConfig vsmfieldsConfig(Schema schema) {
VsmFields vsmFields = new VsmFields(schema);
VsmfieldsConfig.Builder cfgBuilder = new VsmfieldsConfig.Builder();
vsmFields.getConfig(cfgBuilder);
- VsmfieldsConfig cfg = cfgBuilder.build();
+ return cfgBuilder.build();
+ }
+
+ @Test
+ void reference_type_field_is_unsearchable() {
+ Schema schema = createSchema();
+ SDField field = new TemporarySDField(schema.getDocument(), "ref_field", NewDocumentReferenceDataType.forDocumentName("parent_type"));
+ field.parseIndexingScript("{ summary }");
+ schema.getDocument().addField(field);
+ VsmfieldsConfig cfg = vsmfieldsConfig(schema);
assertEquals(1, cfg.fieldspec().size());
VsmfieldsConfig.Fieldspec fieldSpec = cfg.fieldspec().get(0);
assertEquals("ref_field", fieldSpec.name());
assertEquals(VsmfieldsConfig.Fieldspec.Searchmethod.NONE, fieldSpec.searchmethod());
}
+
+ private void testIndexMatching(Matching matching, VsmfieldsConfig.Fieldspec.Normalize.Enum normalize, String arg1) {
+ Schema schema = createSchema();
+ SDField field = new TemporarySDField(schema.getDocument(), "f", DataType.STRING);
+ field.parseIndexingScript("{ index }");
+ field.setMatching(matching);
+ schema.getDocument().addField(field);
+ VsmfieldsConfig cfg = vsmfieldsConfig(schema);
+ VsmfieldsConfig.Fieldspec fieldSpec = cfg.fieldspec().get(0);
+ assertEquals("f", fieldSpec.name());
+ assertEquals(VsmfieldsConfig.Fieldspec.Searchmethod.AUTOUTF8, fieldSpec.searchmethod());
+ assertEquals(normalize, fieldSpec.normalize());
+ assertEquals(arg1, fieldSpec.arg1());
+ }
+
+ @Test
+ void test_exact_string() {
+ testIndexMatching(new Matching(MatchType.TEXT),
+ VsmfieldsConfig.Fieldspec.Normalize.LOWERCASE_AND_FOLD, "");
+ testIndexMatching(new Matching(MatchType.TEXT).setCase(Case.CASED),
+ VsmfieldsConfig.Fieldspec.Normalize.NONE, "");
+ testIndexMatching(new Matching(MatchType.EXACT).setCase(Case.CASED),
+ VsmfieldsConfig.Fieldspec.Normalize.LOWERCASE, "exact");
+ }
}