diff options
author | Jon Bratseth <bratseth@gmail.com> | 2022-02-21 14:53:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-21 14:53:47 +0100 |
commit | 452d37ae81db8ca6dd59e698a23d7fd41552390c (patch) | |
tree | 89bc483cd4c61e126b70caabd03a3ea92441e124 | |
parent | d8d2581d518ac58ef43079c8f386c3e51c2dd743 (diff) | |
parent | 165b2c60a62b05db03934defac53bd66c9163eb5 (diff) |
Merge pull request #21289 from vespa-engine/bratseth/test-structufieldset
Test a fieldset using struct fields
4 files changed, 134 insertions, 0 deletions
diff --git a/config-model/src/test/derived/structandfieldset/documentmanager.cfg b/config-model/src/test/derived/structandfieldset/documentmanager.cfg new file mode 100644 index 00000000000..64677184fb7 --- /dev/null +++ b/config-model/src/test/derived/structandfieldset/documentmanager.cfg @@ -0,0 +1,54 @@ +enablecompression false +usev8geopositions false +datatype[].id 1381038251 +datatype[].structtype[].name "position" +datatype[].structtype[].version 0 +datatype[].structtype[].compresstype NONE +datatype[].structtype[].compresslevel 0 +datatype[].structtype[].compressthreshold 95 +datatype[].structtype[].compressminsize 800 +datatype[].structtype[].field[].name "x" +datatype[].structtype[].field[].datatype 0 +datatype[].structtype[].field[].detailedtype "" +datatype[].structtype[].field[].name "y" +datatype[].structtype[].field[].datatype 0 +datatype[].structtype[].field[].detailedtype "" +datatype[].id -283419354 +datatype[].arraytype[].datatype 443162583 +datatype[].id 443162583 +datatype[].structtype[].name "person" +datatype[].structtype[].version 0 +datatype[].structtype[].compresstype NONE +datatype[].structtype[].compresslevel 0 +datatype[].structtype[].compressthreshold 95 +datatype[].structtype[].compressminsize 800 +datatype[].structtype[].field[].name "first_name" +datatype[].structtype[].field[].datatype 2 +datatype[].structtype[].field[].detailedtype "" +datatype[].structtype[].field[].name "last_name" +datatype[].structtype[].field[].datatype 2 +datatype[].structtype[].field[].detailedtype "" +datatype[].id 306916075 +datatype[].structtype[].name "test.header" +datatype[].structtype[].version 0 +datatype[].structtype[].compresstype NONE +datatype[].structtype[].compresslevel 0 +datatype[].structtype[].compressthreshold 95 +datatype[].structtype[].compressminsize 800 +datatype[].structtype[].field[].name "tag" +datatype[].structtype[].field[].datatype 2 +datatype[].structtype[].field[].detailedtype "" +datatype[].structtype[].field[].name "people" +datatype[].structtype[].field[].datatype -283419354 +datatype[].structtype[].field[].detailedtype "" +datatype[].id -877171244 +datatype[].documenttype[].name "test" +datatype[].documenttype[].version 0 +datatype[].documenttype[].inherits[].name "document" +datatype[].documenttype[].inherits[].version 0 +datatype[].documenttype[].headerstruct 306916075 +datatype[].documenttype[].bodystruct 0 +datatype[].documenttype[].fieldsets{default}.fields[] "people.first_name" +datatype[].documenttype[].fieldsets{default}.fields[] "tag" +datatype[].documenttype[].fieldsets{[]}.fields[] "people" +datatype[].documenttype[].fieldsets{[]}.fields[] "tag" diff --git a/config-model/src/test/derived/structandfieldset/index-info.cfg b/config-model/src/test/derived/structandfieldset/index-info.cfg new file mode 100644 index 00000000000..e1a97fe5eea --- /dev/null +++ b/config-model/src/test/derived/structandfieldset/index-info.cfg @@ -0,0 +1,49 @@ +indexinfo[].name "test" +indexinfo[].command[].indexname "sddocname" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "sddocname" +indexinfo[].command[].command "word" +indexinfo[].command[].indexname "tag" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "tag" +indexinfo[].command[].command "lowercase" +indexinfo[].command[].indexname "tag" +indexinfo[].command[].command "attribute" +indexinfo[].command[].indexname "tag" +indexinfo[].command[].command "type string" +indexinfo[].command[].indexname "tag" +indexinfo[].command[].command "word" +indexinfo[].command[].indexname "people.first_name" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "people.first_name" +indexinfo[].command[].command "lowercase" +indexinfo[].command[].indexname "people.first_name" +indexinfo[].command[].command "attribute" +indexinfo[].command[].indexname "people.first_name" +indexinfo[].command[].command "type string" +indexinfo[].command[].indexname "people.first_name" +indexinfo[].command[].command "word" +indexinfo[].command[].indexname "people.last_name" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "people.last_name" +indexinfo[].command[].command "lowercase" +indexinfo[].command[].indexname "people.last_name" +indexinfo[].command[].command "attribute" +indexinfo[].command[].indexname "people.last_name" +indexinfo[].command[].command "type string" +indexinfo[].command[].indexname "people.last_name" +indexinfo[].command[].command "word" +indexinfo[].command[].indexname "people" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "people" +indexinfo[].command[].command "multivalue" +indexinfo[].command[].indexname "people" +indexinfo[].command[].command "type Array<person>" +indexinfo[].command[].indexname "default" +indexinfo[].command[].command "lowercase" +indexinfo[].command[].indexname "default" +indexinfo[].command[].command "attribute" +indexinfo[].command[].indexname "default" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "default" +indexinfo[].command[].command "word" diff --git a/config-model/src/test/derived/structandfieldset/test.sd b/config-model/src/test/derived/structandfieldset/test.sd new file mode 100644 index 00000000000..77316eab9c9 --- /dev/null +++ b/config-model/src/test/derived/structandfieldset/test.sd @@ -0,0 +1,26 @@ +schema test { + + document test { + + field tag type string { + indexing: attribute + } + + struct person { + field first_name type string {} + field last_name type string {} + } + + field people type array<person> { + indexing: summary + struct-field first_name { indexing: attribute } + struct-field last_name { indexing: attribute } + } + + } + + fieldset default { + fields: tag, people.first_name + } + +} diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/ExportingTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/ExportingTestCase.java index 05f8f1a6b93..719d353f03a 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/derived/ExportingTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/ExportingTestCase.java @@ -187,4 +187,9 @@ public class ExportingTestCase extends AbstractExportingTestCase { assertCorrectDeriving("rankprofilemodularity"); } + @Test + public void testStructAndFieldSet() throws IOException, ParseException { + assertCorrectDeriving("structandfieldset"); + } + } |