diff options
author | Arne H Juul <arnej@yahooinc.com> | 2022-03-09 09:17:25 +0000 |
---|---|---|
committer | Arne H Juul <arnej@yahooinc.com> | 2022-03-09 09:42:57 +0000 |
commit | 9322d0cc71f7b7919f76be2f993c7b9a11158cb8 (patch) | |
tree | bddfdc4bdbc68a542f07d546d86179324cf2a652 /config-model | |
parent | d0ca7f8add1f42e9ed5d0843468ea28426c35135 (diff) |
add some new tests
Diffstat (limited to 'config-model')
17 files changed, 885 insertions, 0 deletions
diff --git a/config-model/src/test/derived/matchsettings_map_after/index-info.cfg b/config-model/src/test/derived/matchsettings_map_after/index-info.cfg new file mode 100644 index 00000000000..c9749afb102 --- /dev/null +++ b/config-model/src/test/derived/matchsettings_map_after/index-info.cfg @@ -0,0 +1,35 @@ +indexinfo[].name "test" +indexinfo[].command[].indexname "sddocname" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "sddocname" +indexinfo[].command[].command "word" +indexinfo[].command[].indexname "mse4.key" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mse4.key" +indexinfo[].command[].command "type string" +indexinfo[].command[].indexname "mse4.key" +indexinfo[].command[].command "exact @mse4_key@" +indexinfo[].command[].indexname "mse4.value.sf1s" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mse4.value.sf1s" +indexinfo[].command[].command "type string" +indexinfo[].command[].indexname "mse4.value.sf1s" +indexinfo[].command[].command "exact @mse4_value_sf1s@" +indexinfo[].command[].indexname "mse4.value.sf2i" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mse4.value.sf2i" +indexinfo[].command[].command "attribute" +indexinfo[].command[].indexname "mse4.value.sf2i" +indexinfo[].command[].command "numerical" +indexinfo[].command[].indexname "mse4.value.sf2i" +indexinfo[].command[].command "type int" +indexinfo[].command[].indexname "mse4.value" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mse4.value" +indexinfo[].command[].command "type elem" +indexinfo[].command[].indexname "mse4" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mse4" +indexinfo[].command[].command "multivalue" +indexinfo[].command[].indexname "mse4" +indexinfo[].command[].command "type Map<string,elem>"
\ No newline at end of file diff --git a/config-model/src/test/derived/matchsettings_map_after/test.sd b/config-model/src/test/derived/matchsettings_map_after/test.sd new file mode 100644 index 00000000000..b35f2af49b7 --- /dev/null +++ b/config-model/src/test/derived/matchsettings_map_after/test.sd @@ -0,0 +1,34 @@ + +# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +search test { + document test { + + struct elem { + field sf1s type string {} + field sf2i type int {} + } + + field mse4 type map<string,elem> { + indexing: summary + struct-field key { + indexing: index + match { + exact + exact-terminator: "@mse4_key@" + } + } + struct-field value.sf1s { + indexing: index + match { + exact + exact-terminator: "@mse4_value_sf1s@" + } + } + struct-field value.sf2i { + indexing: attribute + } + } + + } +} diff --git a/config-model/src/test/derived/matchsettings_map_def/index-info.cfg b/config-model/src/test/derived/matchsettings_map_def/index-info.cfg new file mode 100644 index 00000000000..747396b3a0a --- /dev/null +++ b/config-model/src/test/derived/matchsettings_map_def/index-info.cfg @@ -0,0 +1,105 @@ +indexinfo[].name "test" +indexinfo[].command[].indexname "sddocname" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "sddocname" +indexinfo[].command[].command "word" +indexinfo[].command[].indexname "mss3.key" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mss3.key" +indexinfo[].command[].command "lowercase" +indexinfo[].command[].indexname "mss3.key" +indexinfo[].command[].command "stem:BEST" +indexinfo[].command[].indexname "mss3.key" +indexinfo[].command[].command "normalize" +indexinfo[].command[].indexname "mss3.key" +indexinfo[].command[].command "plain-tokens" +indexinfo[].command[].indexname "mss3.key" +indexinfo[].command[].command "type string" +indexinfo[].command[].indexname "mss3.value" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mss3.value" +indexinfo[].command[].command "lowercase" +indexinfo[].command[].indexname "mss3.value" +indexinfo[].command[].command "stem:BEST" +indexinfo[].command[].indexname "mss3.value" +indexinfo[].command[].command "normalize" +indexinfo[].command[].indexname "mss3.value" +indexinfo[].command[].command "plain-tokens" +indexinfo[].command[].indexname "mss3.value" +indexinfo[].command[].command "type string" +indexinfo[].command[].indexname "mss3" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mss3" +indexinfo[].command[].command "lowercase" +indexinfo[].command[].indexname "mss3" +indexinfo[].command[].command "multivalue" +indexinfo[].command[].indexname "mss3" +indexinfo[].command[].command "plain-tokens" +indexinfo[].command[].indexname "mss3" +indexinfo[].command[].command "type Map<string,string>" +indexinfo[].command[].indexname "mse4.key" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mse4.key" +indexinfo[].command[].command "type string" +indexinfo[].command[].indexname "mse4.value.sf1s" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mse4.value.sf1s" +indexinfo[].command[].command "type string" +indexinfo[].command[].indexname "mse4.value.sf2i" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mse4.value.sf2i" +indexinfo[].command[].command "attribute" +indexinfo[].command[].indexname "mse4.value.sf2i" +indexinfo[].command[].command "numerical" +indexinfo[].command[].indexname "mse4.value.sf2i" +indexinfo[].command[].command "type int" +indexinfo[].command[].indexname "mse4.value" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mse4.value" +indexinfo[].command[].command "type elem" +indexinfo[].command[].indexname "mse4" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mse4" +indexinfo[].command[].command "multivalue" +indexinfo[].command[].indexname "mse4" +indexinfo[].command[].command "type Map<string,elem>" +indexinfo[].command[].indexname "mse5.key" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mse5.key" +indexinfo[].command[].command "lowercase" +indexinfo[].command[].indexname "mse5.key" +indexinfo[].command[].command "attribute" +indexinfo[].command[].indexname "mse5.key" +indexinfo[].command[].command "fast-search" +indexinfo[].command[].indexname "mse5.key" +indexinfo[].command[].command "type string" +indexinfo[].command[].indexname "mse5.key" +indexinfo[].command[].command "word" +indexinfo[].command[].indexname "mse5.value.sf1s" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mse5.value.sf1s" +indexinfo[].command[].command "lowercase" +indexinfo[].command[].indexname "mse5.value.sf1s" +indexinfo[].command[].command "attribute" +indexinfo[].command[].indexname "mse5.value.sf1s" +indexinfo[].command[].command "type string" +indexinfo[].command[].indexname "mse5.value.sf1s" +indexinfo[].command[].command "word" +indexinfo[].command[].indexname "mse5.value.sf2i" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mse5.value.sf2i" +indexinfo[].command[].command "attribute" +indexinfo[].command[].indexname "mse5.value.sf2i" +indexinfo[].command[].command "numerical" +indexinfo[].command[].indexname "mse5.value.sf2i" +indexinfo[].command[].command "type int" +indexinfo[].command[].indexname "mse5.value" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mse5.value" +indexinfo[].command[].command "type elem" +indexinfo[].command[].indexname "mse5" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mse5" +indexinfo[].command[].command "multivalue" +indexinfo[].command[].indexname "mse5" +indexinfo[].command[].command "type Map<string,elem>"
\ No newline at end of file diff --git a/config-model/src/test/derived/matchsettings_map_def/test.sd b/config-model/src/test/derived/matchsettings_map_def/test.sd new file mode 100644 index 00000000000..7f2517c80fc --- /dev/null +++ b/config-model/src/test/derived/matchsettings_map_def/test.sd @@ -0,0 +1,50 @@ + +# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +search test { + document test { + + struct elem { + field sf1s type string {} + field sf2i type int {} + } + + field mss3 type map<string,string> { + indexing: index + struct-field key { + indexing: index + } + struct-field value { + indexing: index + } + } + + field mse4 type map<string,elem> { + indexing: summary + struct-field key { + indexing: index + } + struct-field value.sf1s { + indexing: index + } + struct-field value.sf2i { + indexing: attribute + } + } + + field mse5 type map<string,elem> { + indexing: summary + struct-field key { + indexing: attribute + attribute: fast-search + } + struct-field value.sf1s { + indexing: attribute + } + struct-field value.sf2i { + indexing: attribute + } + } + + } +} diff --git a/config-model/src/test/derived/matchsettings_map_wfs/index-info.cfg b/config-model/src/test/derived/matchsettings_map_wfs/index-info.cfg new file mode 100644 index 00000000000..2fdb056e90a --- /dev/null +++ b/config-model/src/test/derived/matchsettings_map_wfs/index-info.cfg @@ -0,0 +1,101 @@ +indexinfo[].name "test" +indexinfo[].command[].indexname "sddocname" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "sddocname" +indexinfo[].command[].command "word" +indexinfo[].command[].indexname "mss3.key" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mss3.key" +indexinfo[].command[].command "lowercase" +indexinfo[].command[].indexname "mss3.key" +indexinfo[].command[].command "type string" +indexinfo[].command[].indexname "mss3.key" +indexinfo[].command[].command "exact @mss3_key@" +indexinfo[].command[].indexname "mss3.value" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mss3.value" +indexinfo[].command[].command "lowercase" +indexinfo[].command[].indexname "mss3.value" +indexinfo[].command[].command "type string" +indexinfo[].command[].indexname "mss3.value" +indexinfo[].command[].command "exact @mss3_value@" +indexinfo[].command[].indexname "mss3" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mss3" +indexinfo[].command[].command "lowercase" +indexinfo[].command[].indexname "mss3" +indexinfo[].command[].command "multivalue" +indexinfo[].command[].indexname "mss3" +indexinfo[].command[].command "plain-tokens" +indexinfo[].command[].indexname "mss3" +indexinfo[].command[].command "type Map<string,string>" +indexinfo[].command[].indexname "mse4.key" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mse4.key" +indexinfo[].command[].command "type string" +indexinfo[].command[].indexname "mse4.key" +indexinfo[].command[].command "exact @mse4_key@" +indexinfo[].command[].indexname "mse4.value.sf1s" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mse4.value.sf1s" +indexinfo[].command[].command "type string" +indexinfo[].command[].indexname "mse4.value.sf1s" +indexinfo[].command[].command "exact @mse4_value_sf1s@" +indexinfo[].command[].indexname "mse4.value.sf2i" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mse4.value.sf2i" +indexinfo[].command[].command "attribute" +indexinfo[].command[].indexname "mse4.value.sf2i" +indexinfo[].command[].command "numerical" +indexinfo[].command[].indexname "mse4.value.sf2i" +indexinfo[].command[].command "type int" +indexinfo[].command[].indexname "mse4.value" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mse4.value" +indexinfo[].command[].command "type elem" +indexinfo[].command[].indexname "mse4" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mse4" +indexinfo[].command[].command "multivalue" +indexinfo[].command[].indexname "mse4" +indexinfo[].command[].command "type Map<string,elem>" +indexinfo[].command[].indexname "mse5.key" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mse5.key" +indexinfo[].command[].command "lowercase" +indexinfo[].command[].indexname "mse5.key" +indexinfo[].command[].command "attribute" +indexinfo[].command[].indexname "mse5.key" +indexinfo[].command[].command "fast-search" +indexinfo[].command[].indexname "mse5.key" +indexinfo[].command[].command "type string" +indexinfo[].command[].indexname "mse5.key" +indexinfo[].command[].command "exact @mse5_key@" +indexinfo[].command[].indexname "mse5.value.sf1s" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mse5.value.sf1s" +indexinfo[].command[].command "lowercase" +indexinfo[].command[].indexname "mse5.value.sf1s" +indexinfo[].command[].command "attribute" +indexinfo[].command[].indexname "mse5.value.sf1s" +indexinfo[].command[].command "type string" +indexinfo[].command[].indexname "mse5.value.sf1s" +indexinfo[].command[].command "exact @mse5_value_sf1s@" +indexinfo[].command[].indexname "mse5.value.sf2i" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mse5.value.sf2i" +indexinfo[].command[].command "attribute" +indexinfo[].command[].indexname "mse5.value.sf2i" +indexinfo[].command[].command "numerical" +indexinfo[].command[].indexname "mse5.value.sf2i" +indexinfo[].command[].command "type int" +indexinfo[].command[].indexname "mse5.value" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mse5.value" +indexinfo[].command[].command "type elem" +indexinfo[].command[].indexname "mse5" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mse5" +indexinfo[].command[].command "multivalue" +indexinfo[].command[].indexname "mse5" +indexinfo[].command[].command "type Map<string,elem>"
\ No newline at end of file diff --git a/config-model/src/test/derived/matchsettings_map_wfs/test.sd b/config-model/src/test/derived/matchsettings_map_wfs/test.sd new file mode 100644 index 00000000000..12c0c395282 --- /dev/null +++ b/config-model/src/test/derived/matchsettings_map_wfs/test.sd @@ -0,0 +1,72 @@ + +# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +search test { + document test { + + struct elem { + field sf1s type string {} + field sf2i type int {} + } + + field mss3 type map<string,string> { + indexing: index + struct-field key { + match { + exact + exact-terminator: "@mss3_key@" + } + } + struct-field value { + match { + exact + exact-terminator: "@mss3_value@" + } + } + } + + field mse4 type map<string,elem> { + indexing: summary + struct-field key { + indexing: index + match { + exact + exact-terminator: "@mse4_key@" + } + } + struct-field value.sf1s { + indexing: index + match { + exact + exact-terminator: "@mse4_value_sf1s@" + } + } + struct-field value.sf2i { + indexing: attribute + } + } + + field mse5 type map<string,elem> { + indexing: summary + struct-field key { + indexing: attribute + attribute: fast-search + match { + exact + exact-terminator: "@mse5_key@" + } + } + struct-field value.sf1s { + indexing: attribute + match { + exact + exact-terminator: "@mse5_value_sf1s@" + } + } + struct-field value.sf2i { + indexing: attribute + } + } + + } +} diff --git a/config-model/src/test/derived/matchsettings_map_wss/index-info.cfg b/config-model/src/test/derived/matchsettings_map_wss/index-info.cfg new file mode 100644 index 00000000000..747396b3a0a --- /dev/null +++ b/config-model/src/test/derived/matchsettings_map_wss/index-info.cfg @@ -0,0 +1,105 @@ +indexinfo[].name "test" +indexinfo[].command[].indexname "sddocname" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "sddocname" +indexinfo[].command[].command "word" +indexinfo[].command[].indexname "mss3.key" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mss3.key" +indexinfo[].command[].command "lowercase" +indexinfo[].command[].indexname "mss3.key" +indexinfo[].command[].command "stem:BEST" +indexinfo[].command[].indexname "mss3.key" +indexinfo[].command[].command "normalize" +indexinfo[].command[].indexname "mss3.key" +indexinfo[].command[].command "plain-tokens" +indexinfo[].command[].indexname "mss3.key" +indexinfo[].command[].command "type string" +indexinfo[].command[].indexname "mss3.value" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mss3.value" +indexinfo[].command[].command "lowercase" +indexinfo[].command[].indexname "mss3.value" +indexinfo[].command[].command "stem:BEST" +indexinfo[].command[].indexname "mss3.value" +indexinfo[].command[].command "normalize" +indexinfo[].command[].indexname "mss3.value" +indexinfo[].command[].command "plain-tokens" +indexinfo[].command[].indexname "mss3.value" +indexinfo[].command[].command "type string" +indexinfo[].command[].indexname "mss3" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mss3" +indexinfo[].command[].command "lowercase" +indexinfo[].command[].indexname "mss3" +indexinfo[].command[].command "multivalue" +indexinfo[].command[].indexname "mss3" +indexinfo[].command[].command "plain-tokens" +indexinfo[].command[].indexname "mss3" +indexinfo[].command[].command "type Map<string,string>" +indexinfo[].command[].indexname "mse4.key" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mse4.key" +indexinfo[].command[].command "type string" +indexinfo[].command[].indexname "mse4.value.sf1s" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mse4.value.sf1s" +indexinfo[].command[].command "type string" +indexinfo[].command[].indexname "mse4.value.sf2i" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mse4.value.sf2i" +indexinfo[].command[].command "attribute" +indexinfo[].command[].indexname "mse4.value.sf2i" +indexinfo[].command[].command "numerical" +indexinfo[].command[].indexname "mse4.value.sf2i" +indexinfo[].command[].command "type int" +indexinfo[].command[].indexname "mse4.value" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mse4.value" +indexinfo[].command[].command "type elem" +indexinfo[].command[].indexname "mse4" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mse4" +indexinfo[].command[].command "multivalue" +indexinfo[].command[].indexname "mse4" +indexinfo[].command[].command "type Map<string,elem>" +indexinfo[].command[].indexname "mse5.key" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mse5.key" +indexinfo[].command[].command "lowercase" +indexinfo[].command[].indexname "mse5.key" +indexinfo[].command[].command "attribute" +indexinfo[].command[].indexname "mse5.key" +indexinfo[].command[].command "fast-search" +indexinfo[].command[].indexname "mse5.key" +indexinfo[].command[].command "type string" +indexinfo[].command[].indexname "mse5.key" +indexinfo[].command[].command "word" +indexinfo[].command[].indexname "mse5.value.sf1s" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mse5.value.sf1s" +indexinfo[].command[].command "lowercase" +indexinfo[].command[].indexname "mse5.value.sf1s" +indexinfo[].command[].command "attribute" +indexinfo[].command[].indexname "mse5.value.sf1s" +indexinfo[].command[].command "type string" +indexinfo[].command[].indexname "mse5.value.sf1s" +indexinfo[].command[].command "word" +indexinfo[].command[].indexname "mse5.value.sf2i" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mse5.value.sf2i" +indexinfo[].command[].command "attribute" +indexinfo[].command[].indexname "mse5.value.sf2i" +indexinfo[].command[].command "numerical" +indexinfo[].command[].indexname "mse5.value.sf2i" +indexinfo[].command[].command "type int" +indexinfo[].command[].indexname "mse5.value" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mse5.value" +indexinfo[].command[].command "type elem" +indexinfo[].command[].indexname "mse5" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "mse5" +indexinfo[].command[].command "multivalue" +indexinfo[].command[].indexname "mse5" +indexinfo[].command[].command "type Map<string,elem>"
\ No newline at end of file diff --git a/config-model/src/test/derived/matchsettings_map_wss/test.sd b/config-model/src/test/derived/matchsettings_map_wss/test.sd new file mode 100644 index 00000000000..58162ea93fc --- /dev/null +++ b/config-model/src/test/derived/matchsettings_map_wss/test.sd @@ -0,0 +1,55 @@ + +# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +search test { + document test { + + struct elem { + field sf1s type string { + match { + exact + exact-terminator: "@elem_sf1s@" + } + } + field sf2i type int {} + } + + field mss3 type map<string,string> { + indexing: index + struct-field key { + indexing: index + } + struct-field value { + indexing: index + } + } + + field mse4 type map<string,elem> { + indexing: summary + struct-field key { + indexing: index + } + struct-field value.sf1s { + indexing: index + } + struct-field value.sf2i { + indexing: attribute + } + } + + field mse5 type map<string,elem> { + indexing: summary + struct-field key { + indexing: attribute + attribute: fast-search + } + struct-field value.sf1s { + indexing: attribute + } + struct-field value.sf2i { + indexing: attribute + } + } + + } +} diff --git a/config-model/src/test/derived/matchsettings_simple_def/index-info.cfg b/config-model/src/test/derived/matchsettings_simple_def/index-info.cfg new file mode 100644 index 00000000000..fbd7b7755cc --- /dev/null +++ b/config-model/src/test/derived/matchsettings_simple_def/index-info.cfg @@ -0,0 +1,33 @@ +indexinfo[].name "test" +indexinfo[].command[].indexname "sddocname" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "sddocname" +indexinfo[].command[].command "word" +indexinfo[].command[].indexname "field_1_string" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "field_1_string" +indexinfo[].command[].command "lowercase" +indexinfo[].command[].indexname "field_1_string" +indexinfo[].command[].command "stem:BEST" +indexinfo[].command[].indexname "field_1_string" +indexinfo[].command[].command "normalize" +indexinfo[].command[].indexname "field_1_string" +indexinfo[].command[].command "plain-tokens" +indexinfo[].command[].indexname "field_1_string" +indexinfo[].command[].command "type string" +indexinfo[].command[].indexname "field_2_struct.elem_field_1_string" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "field_2_struct.elem_field_1_string" +indexinfo[].command[].command "type string" +indexinfo[].command[].indexname "field_2_struct.elem_field_2_int" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "field_2_struct.elem_field_2_int" +indexinfo[].command[].command "attribute" +indexinfo[].command[].indexname "field_2_struct.elem_field_2_int" +indexinfo[].command[].command "numerical" +indexinfo[].command[].indexname "field_2_struct.elem_field_2_int" +indexinfo[].command[].command "type int" +indexinfo[].command[].indexname "field_2_struct" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "field_2_struct" +indexinfo[].command[].command "type elem" diff --git a/config-model/src/test/derived/matchsettings_simple_def/test.sd b/config-model/src/test/derived/matchsettings_simple_def/test.sd new file mode 100644 index 00000000000..8d5a1733a44 --- /dev/null +++ b/config-model/src/test/derived/matchsettings_simple_def/test.sd @@ -0,0 +1,27 @@ + +# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +search test { + document test { + + struct elem { + field elem_field_1_string type string {} + field elem_field_2_int type int {} + } + + field field_1_string type string { + indexing: index + } + + field field_2_struct type elem { + indexing: summary + struct-field elem_field_1_string { + indexing: index + } + struct-field elem_field_2_int { + indexing: attribute + } + } + + } +} diff --git a/config-model/src/test/derived/matchsettings_simple_wfs/index-info.cfg b/config-model/src/test/derived/matchsettings_simple_wfs/index-info.cfg new file mode 100644 index 00000000000..8362870f427 --- /dev/null +++ b/config-model/src/test/derived/matchsettings_simple_wfs/index-info.cfg @@ -0,0 +1,31 @@ +indexinfo[].name "test" +indexinfo[].command[].indexname "sddocname" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "sddocname" +indexinfo[].command[].command "word" +indexinfo[].command[].indexname "field_1_string" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "field_1_string" +indexinfo[].command[].command "lowercase" +indexinfo[].command[].indexname "field_1_string" +indexinfo[].command[].command "type string" +indexinfo[].command[].indexname "field_1_string" +indexinfo[].command[].command "exact @f1s@" +indexinfo[].command[].indexname "field_2_struct.elem_field_1_string" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "field_2_struct.elem_field_1_string" +indexinfo[].command[].command "type string" +indexinfo[].command[].indexname "field_2_struct.elem_field_1_string" +indexinfo[].command[].command "exact @f2s@" +indexinfo[].command[].indexname "field_2_struct.elem_field_2_int" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "field_2_struct.elem_field_2_int" +indexinfo[].command[].command "attribute" +indexinfo[].command[].indexname "field_2_struct.elem_field_2_int" +indexinfo[].command[].command "numerical" +indexinfo[].command[].indexname "field_2_struct.elem_field_2_int" +indexinfo[].command[].command "type int" +indexinfo[].command[].indexname "field_2_struct" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "field_2_struct" +indexinfo[].command[].command "type elem" diff --git a/config-model/src/test/derived/matchsettings_simple_wfs/test.sd b/config-model/src/test/derived/matchsettings_simple_wfs/test.sd new file mode 100644 index 00000000000..9c709d8167e --- /dev/null +++ b/config-model/src/test/derived/matchsettings_simple_wfs/test.sd @@ -0,0 +1,35 @@ + +# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +search test { + document test { + + struct elem { + field elem_field_1_string type string {} + field elem_field_2_int type int {} + } + + field field_1_string type string { + indexing: index + match { + exact + exact-terminator: "@f1s@" + } + } + + field field_2_struct type elem { + indexing: summary + struct-field elem_field_1_string { + indexing: index + match { + exact + exact-terminator: "@f2s@" + } + } + struct-field elem_field_2_int { + indexing: attribute + } + } + + } +} diff --git a/config-model/src/test/derived/matchsettings_simple_wss/index-info.cfg b/config-model/src/test/derived/matchsettings_simple_wss/index-info.cfg new file mode 100644 index 00000000000..dda78b04f9b --- /dev/null +++ b/config-model/src/test/derived/matchsettings_simple_wss/index-info.cfg @@ -0,0 +1,31 @@ +indexinfo[].name "test" +indexinfo[].command[].indexname "sddocname" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "sddocname" +indexinfo[].command[].command "word" +indexinfo[].command[].indexname "field_1_string" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "field_1_string" +indexinfo[].command[].command "lowercase" +indexinfo[].command[].indexname "field_1_string" +indexinfo[].command[].command "type string" +indexinfo[].command[].indexname "field_1_string" +indexinfo[].command[].command "exact @f1s@" +indexinfo[].command[].indexname "field_2_struct.elem_field_1_string" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "field_2_struct.elem_field_1_string" +indexinfo[].command[].command "type string" +indexinfo[].command[].indexname "field_2_struct.elem_field_1_string" +indexinfo[].command[].command "exact @ef1@" +indexinfo[].command[].indexname "field_2_struct.elem_field_2_int" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "field_2_struct.elem_field_2_int" +indexinfo[].command[].command "attribute" +indexinfo[].command[].indexname "field_2_struct.elem_field_2_int" +indexinfo[].command[].command "numerical" +indexinfo[].command[].indexname "field_2_struct.elem_field_2_int" +indexinfo[].command[].command "type int" +indexinfo[].command[].indexname "field_2_struct" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "field_2_struct" +indexinfo[].command[].command "type elem" diff --git a/config-model/src/test/derived/matchsettings_simple_wss/test.sd b/config-model/src/test/derived/matchsettings_simple_wss/test.sd new file mode 100644 index 00000000000..451d9ad06d8 --- /dev/null +++ b/config-model/src/test/derived/matchsettings_simple_wss/test.sd @@ -0,0 +1,36 @@ + +# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +search test { + document test { + + struct elem { + field elem_field_1_string type string { + match { + exact + exact-terminator: "@ef1@" + } + } + field elem_field_2_int type int {} + } + + field field_1_string type string { + indexing: index + match { + exact + exact-terminator: "@f1s@" + } + } + + field field_2_struct type elem { + indexing: summary + struct-field elem_field_1_string { + indexing: index + } + struct-field elem_field_2_int { + indexing: attribute + } + } + + } +} diff --git a/config-model/src/test/derived/matchsettings_simple_wss_wfs/index-info.cfg b/config-model/src/test/derived/matchsettings_simple_wss_wfs/index-info.cfg new file mode 100644 index 00000000000..8362870f427 --- /dev/null +++ b/config-model/src/test/derived/matchsettings_simple_wss_wfs/index-info.cfg @@ -0,0 +1,31 @@ +indexinfo[].name "test" +indexinfo[].command[].indexname "sddocname" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "sddocname" +indexinfo[].command[].command "word" +indexinfo[].command[].indexname "field_1_string" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "field_1_string" +indexinfo[].command[].command "lowercase" +indexinfo[].command[].indexname "field_1_string" +indexinfo[].command[].command "type string" +indexinfo[].command[].indexname "field_1_string" +indexinfo[].command[].command "exact @f1s@" +indexinfo[].command[].indexname "field_2_struct.elem_field_1_string" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "field_2_struct.elem_field_1_string" +indexinfo[].command[].command "type string" +indexinfo[].command[].indexname "field_2_struct.elem_field_1_string" +indexinfo[].command[].command "exact @f2s@" +indexinfo[].command[].indexname "field_2_struct.elem_field_2_int" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "field_2_struct.elem_field_2_int" +indexinfo[].command[].command "attribute" +indexinfo[].command[].indexname "field_2_struct.elem_field_2_int" +indexinfo[].command[].command "numerical" +indexinfo[].command[].indexname "field_2_struct.elem_field_2_int" +indexinfo[].command[].command "type int" +indexinfo[].command[].indexname "field_2_struct" +indexinfo[].command[].command "index" +indexinfo[].command[].indexname "field_2_struct" +indexinfo[].command[].command "type elem" diff --git a/config-model/src/test/derived/matchsettings_simple_wss_wfs/test.sd b/config-model/src/test/derived/matchsettings_simple_wss_wfs/test.sd new file mode 100644 index 00000000000..f3967e6ad80 --- /dev/null +++ b/config-model/src/test/derived/matchsettings_simple_wss_wfs/test.sd @@ -0,0 +1,40 @@ + +# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +search test { + document test { + + struct elem { + field elem_field_1_string type string { + match { + exact + exact-terminator: "@ef1@" + } + } + field elem_field_2_int type int {} + } + + field field_1_string type string { + indexing: index + match { + exact + exact-terminator: "@f1s@" + } + } + + field field_2_struct type elem { + indexing: summary + struct-field elem_field_1_string { + indexing: index + match { + exact + exact-terminator: "@f2s@" + } + } + struct-field elem_field_2_int { + indexing: attribute + } + } + + } +} diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/MatchSettingsResolvingTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/MatchSettingsResolvingTestCase.java new file mode 100755 index 00000000000..e112c962ad5 --- /dev/null +++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/MatchSettingsResolvingTestCase.java @@ -0,0 +1,64 @@ +// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.searchdefinition.derived; + +import com.yahoo.config.model.deploy.TestProperties; +import com.yahoo.searchdefinition.parser.ParseException; +import org.junit.Test; + +import java.io.IOException; + +/** + * @author arnej + */ +public class MatchSettingsResolvingTestCase extends AbstractExportingTestCase { + + @Test + public void testSimpleDefaults() throws IOException, ParseException { + assertCorrectDeriving("matchsettings_simple_def", + new TestProperties().setExperimentalSdParsing(false)); + } + + @Test + public void testSimpleWithStructSettings() throws IOException, ParseException { + assertCorrectDeriving("matchsettings_simple_wss", + new TestProperties().setExperimentalSdParsing(false)); + } + + @Test + public void testSimpleWithFieldSettings() throws IOException, ParseException { + assertCorrectDeriving("matchsettings_simple_wfs", + new TestProperties().setExperimentalSdParsing(false)); + } + + @Test + public void testSimpleStructAndFieldSettings() throws IOException, ParseException { + assertCorrectDeriving("matchsettings_simple_wss_wfs", + new TestProperties().setExperimentalSdParsing(false)); + } + + @Test + public void testMapDefaults() throws IOException, ParseException { + assertCorrectDeriving("matchsettings_map_def", + new TestProperties().setExperimentalSdParsing(false)); + } + + @Test + public void testMapWithStructSettings() throws IOException, ParseException { + assertCorrectDeriving("matchsettings_map_wss", + new TestProperties().setExperimentalSdParsing(false)); + } + + @Test + public void testMapWithFieldSettings() throws IOException, ParseException { + assertCorrectDeriving("matchsettings_map_wfs", + new TestProperties().setExperimentalSdParsing(false)); + } + + @Test + public void testMapAfter() throws IOException, ParseException { + assertCorrectDeriving("matchsettings_map_after", + new TestProperties().setExperimentalSdParsing(false)); + } + + +} |