diff options
author | Tor Egge <Tor.Egge@broadpark.no> | 2018-11-22 11:49:02 +0100 |
---|---|---|
committer | Tor Egge <Tor.Egge@broadpark.no> | 2018-11-27 13:10:43 +0100 |
commit | e18be113b03bb8138109ba1c183ab8e282c23ae3 (patch) | |
tree | 0d81b47bc9a5b70cfba04c5ed140156cb050115d /config-model/src/test/derived/imported_struct_fields | |
parent | ca35f62b99a36442be1e9b46d217b176d5a37122 (diff) |
Handle import of array of struct fields, map of struct fields, and map of
primitive fields as long as required attributes are present.
Diffstat (limited to 'config-model/src/test/derived/imported_struct_fields')
8 files changed, 349 insertions, 0 deletions
diff --git a/config-model/src/test/derived/imported_struct_fields/attributes.cfg b/config-model/src/test/derived/imported_struct_fields/attributes.cfg new file mode 100644 index 00000000000..ce6ff5e54ae --- /dev/null +++ b/config-model/src/test/derived/imported_struct_fields/attributes.cfg @@ -0,0 +1,168 @@ +attribute[0].name "parent_ref" +attribute[0].datatype REFERENCE +attribute[0].collectiontype SINGLE +attribute[0].removeifzero false +attribute[0].createifnonexistent false +attribute[0].fastsearch false +attribute[0].huge false +attribute[0].ismutable false +attribute[0].sortascending true +attribute[0].sortfunction UCA +attribute[0].sortstrength PRIMARY +attribute[0].sortlocale "" +attribute[0].enablebitvectors false +attribute[0].enableonlybitvector false +attribute[0].fastaccess false +attribute[0].arity 8 +attribute[0].lowerbound -9223372036854775808 +attribute[0].upperbound 9223372036854775807 +attribute[0].densepostinglistthreshold 0.4 +attribute[0].tensortype "" +attribute[0].imported false +attribute[1].name "my_elem_array.name" +attribute[1].datatype STRING +attribute[1].collectiontype SINGLE +attribute[1].removeifzero false +attribute[1].createifnonexistent false +attribute[1].fastsearch true +attribute[1].huge false +attribute[1].ismutable false +attribute[1].sortascending true +attribute[1].sortfunction UCA +attribute[1].sortstrength PRIMARY +attribute[1].sortlocale "" +attribute[1].enablebitvectors false +attribute[1].enableonlybitvector false +attribute[1].fastaccess false +attribute[1].arity 8 +attribute[1].lowerbound -9223372036854775808 +attribute[1].upperbound 9223372036854775807 +attribute[1].densepostinglistthreshold 0.4 +attribute[1].tensortype "" +attribute[1].imported true +attribute[2].name "my_elem_array.weight" +attribute[2].datatype INT32 +attribute[2].collectiontype SINGLE +attribute[2].removeifzero false +attribute[2].createifnonexistent false +attribute[2].fastsearch false +attribute[2].huge false +attribute[2].ismutable false +attribute[2].sortascending true +attribute[2].sortfunction UCA +attribute[2].sortstrength PRIMARY +attribute[2].sortlocale "" +attribute[2].enablebitvectors false +attribute[2].enableonlybitvector false +attribute[2].fastaccess false +attribute[2].arity 8 +attribute[2].lowerbound -9223372036854775808 +attribute[2].upperbound 9223372036854775807 +attribute[2].densepostinglistthreshold 0.4 +attribute[2].tensortype "" +attribute[2].imported true +attribute[3].name "my_elem_map.key" +attribute[3].datatype STRING +attribute[3].collectiontype SINGLE +attribute[3].removeifzero false +attribute[3].createifnonexistent false +attribute[3].fastsearch true +attribute[3].huge false +attribute[3].ismutable false +attribute[3].sortascending true +attribute[3].sortfunction UCA +attribute[3].sortstrength PRIMARY +attribute[3].sortlocale "" +attribute[3].enablebitvectors false +attribute[3].enableonlybitvector false +attribute[3].fastaccess false +attribute[3].arity 8 +attribute[3].lowerbound -9223372036854775808 +attribute[3].upperbound 9223372036854775807 +attribute[3].densepostinglistthreshold 0.4 +attribute[3].tensortype "" +attribute[3].imported true +attribute[4].name "my_elem_map.value.name" +attribute[4].datatype STRING +attribute[4].collectiontype SINGLE +attribute[4].removeifzero false +attribute[4].createifnonexistent false +attribute[4].fastsearch true +attribute[4].huge false +attribute[4].ismutable false +attribute[4].sortascending true +attribute[4].sortfunction UCA +attribute[4].sortstrength PRIMARY +attribute[4].sortlocale "" +attribute[4].enablebitvectors false +attribute[4].enableonlybitvector false +attribute[4].fastaccess false +attribute[4].arity 8 +attribute[4].lowerbound -9223372036854775808 +attribute[4].upperbound 9223372036854775807 +attribute[4].densepostinglistthreshold 0.4 +attribute[4].tensortype "" +attribute[4].imported true +attribute[5].name "my_elem_map.value.weight" +attribute[5].datatype INT32 +attribute[5].collectiontype SINGLE +attribute[5].removeifzero false +attribute[5].createifnonexistent false +attribute[5].fastsearch false +attribute[5].huge false +attribute[5].ismutable false +attribute[5].sortascending true +attribute[5].sortfunction UCA +attribute[5].sortstrength PRIMARY +attribute[5].sortlocale "" +attribute[5].enablebitvectors false +attribute[5].enableonlybitvector false +attribute[5].fastaccess false +attribute[5].arity 8 +attribute[5].lowerbound -9223372036854775808 +attribute[5].upperbound 9223372036854775807 +attribute[5].densepostinglistthreshold 0.4 +attribute[5].tensortype "" +attribute[5].imported true +attribute[6].name "my_str_int_map.key" +attribute[6].datatype STRING +attribute[6].collectiontype SINGLE +attribute[6].removeifzero false +attribute[6].createifnonexistent false +attribute[6].fastsearch true +attribute[6].huge false +attribute[6].ismutable false +attribute[6].sortascending true +attribute[6].sortfunction UCA +attribute[6].sortstrength PRIMARY +attribute[6].sortlocale "" +attribute[6].enablebitvectors false +attribute[6].enableonlybitvector false +attribute[6].fastaccess false +attribute[6].arity 8 +attribute[6].lowerbound -9223372036854775808 +attribute[6].upperbound 9223372036854775807 +attribute[6].densepostinglistthreshold 0.4 +attribute[6].tensortype "" +attribute[6].imported true +attribute[7].name "my_str_int_map.value" +attribute[7].datatype INT32 +attribute[7].collectiontype SINGLE +attribute[7].removeifzero false +attribute[7].createifnonexistent false +attribute[7].fastsearch false +attribute[7].huge false +attribute[7].ismutable false +attribute[7].sortascending true +attribute[7].sortfunction UCA +attribute[7].sortstrength PRIMARY +attribute[7].sortlocale "" +attribute[7].enablebitvectors false +attribute[7].enableonlybitvector false +attribute[7].fastaccess false +attribute[7].arity 8 +attribute[7].lowerbound -9223372036854775808 +attribute[7].upperbound 9223372036854775807 +attribute[7].densepostinglistthreshold 0.4 +attribute[7].tensortype "" +attribute[7].imported true
\ No newline at end of file diff --git a/config-model/src/test/derived/imported_struct_fields/child.sd b/config-model/src/test/derived/imported_struct_fields/child.sd new file mode 100644 index 00000000000..8453031022b --- /dev/null +++ b/config-model/src/test/derived/imported_struct_fields/child.sd @@ -0,0 +1,19 @@ +# Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +search child { + document child { + field parent_ref type reference<parent> { + indexing: attribute | summary + } + } + import field parent_ref.elem_array as my_elem_array {} + import field parent_ref.elem_map as my_elem_map {} + import field parent_ref.str_int_map as my_str_int_map {} + + document-summary mysummary { + summary documentid type string {} + summary my_elem_array type array<elem> {} + summary my_elem_map type map<string, elem> {} + summary my_str_int_map type map<string, int> {} + } +} + diff --git a/config-model/src/test/derived/imported_struct_fields/imported-fields.cfg b/config-model/src/test/derived/imported_struct_fields/imported-fields.cfg new file mode 100644 index 00000000000..772e5cffec9 --- /dev/null +++ b/config-model/src/test/derived/imported_struct_fields/imported-fields.cfg @@ -0,0 +1,35 @@ +attribute[0].name "my_elem_array.name" +attribute[0].referencefield "parent_ref" +attribute[0].targetfield "elem_array.name" +attribute[0].datatype NONE +attribute[0].collectiontype SINGLE +attribute[1].name "my_elem_array.weight" +attribute[1].referencefield "parent_ref" +attribute[1].targetfield "elem_array.weight" +attribute[1].datatype NONE +attribute[1].collectiontype SINGLE +attribute[2].name "my_elem_map.key" +attribute[2].referencefield "parent_ref" +attribute[2].targetfield "elem_map.key" +attribute[2].datatype NONE +attribute[2].collectiontype SINGLE +attribute[3].name "my_elem_map.value.name" +attribute[3].referencefield "parent_ref" +attribute[3].targetfield "elem_map.value.name" +attribute[3].datatype NONE +attribute[3].collectiontype SINGLE +attribute[4].name "my_elem_map.value.weight" +attribute[4].referencefield "parent_ref" +attribute[4].targetfield "elem_map.value.weight" +attribute[4].datatype NONE +attribute[4].collectiontype SINGLE +attribute[5].name "my_str_int_map.key" +attribute[5].referencefield "parent_ref" +attribute[5].targetfield "str_int_map.key" +attribute[5].datatype NONE +attribute[5].collectiontype SINGLE +attribute[6].name "my_str_int_map.value" +attribute[6].referencefield "parent_ref" +attribute[6].targetfield "str_int_map.value" +attribute[6].datatype NONE +attribute[6].collectiontype SINGLE
\ No newline at end of file diff --git a/config-model/src/test/derived/imported_struct_fields/index-info.cfg b/config-model/src/test/derived/imported_struct_fields/index-info.cfg new file mode 100644 index 00000000000..66448099e84 --- /dev/null +++ b/config-model/src/test/derived/imported_struct_fields/index-info.cfg @@ -0,0 +1,37 @@ +indexinfo[0].name "child" +indexinfo[0].command[0].indexname "sddocname" +indexinfo[0].command[0].command "index" +indexinfo[0].command[1].indexname "sddocname" +indexinfo[0].command[1].command "word" +indexinfo[0].command[2].indexname "parent_ref" +indexinfo[0].command[2].command "index" +indexinfo[0].command[3].indexname "parent_ref" +indexinfo[0].command[3].command "attribute" +indexinfo[0].command[4].indexname "parent_ref" +indexinfo[0].command[4].command "word" +indexinfo[0].command[5].indexname "documentid" +indexinfo[0].command[5].command "index" +indexinfo[0].command[6].indexname "rankfeatures" +indexinfo[0].command[6].command "index" +indexinfo[0].command[7].indexname "summaryfeatures" +indexinfo[0].command[7].command "index" +indexinfo[0].command[8].indexname "my_elem_array.name" +indexinfo[0].command[8].command "index" +indexinfo[0].command[9].indexname "my_elem_array.weight" +indexinfo[0].command[9].command "index" +indexinfo[0].command[10].indexname "my_elem_array.weight" +indexinfo[0].command[10].command "numerical" +indexinfo[0].command[11].indexname "my_elem_map.key" +indexinfo[0].command[11].command "index" +indexinfo[0].command[12].indexname "my_elem_map.value.name" +indexinfo[0].command[12].command "index" +indexinfo[0].command[13].indexname "my_elem_map.value.weight" +indexinfo[0].command[13].command "index" +indexinfo[0].command[14].indexname "my_elem_map.value.weight" +indexinfo[0].command[14].command "numerical" +indexinfo[0].command[15].indexname "my_str_int_map.key" +indexinfo[0].command[15].command "index" +indexinfo[0].command[16].indexname "my_str_int_map.value" +indexinfo[0].command[16].command "index" +indexinfo[0].command[17].indexname "my_str_int_map.value" +indexinfo[0].command[17].command "numerical"
\ No newline at end of file diff --git a/config-model/src/test/derived/imported_struct_fields/indexschema.cfg b/config-model/src/test/derived/imported_struct_fields/indexschema.cfg new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/config-model/src/test/derived/imported_struct_fields/indexschema.cfg diff --git a/config-model/src/test/derived/imported_struct_fields/parent.sd b/config-model/src/test/derived/imported_struct_fields/parent.sd new file mode 100644 index 00000000000..7419cb465fd --- /dev/null +++ b/config-model/src/test/derived/imported_struct_fields/parent.sd @@ -0,0 +1,43 @@ +# Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +search parent { + document parent { + struct elem { + field name type string {} + field weight type int {} + } + field elem_array type array<elem> { + indexing: summary + struct-field name { + indexing: attribute + attribute: fast-search + } + struct-field weight { + indexing: attribute + } + } + field elem_map type map<string, elem> { + indexing: summary + struct-field key { + indexing: attribute + attribute: fast-search + } + struct-field value.name { + indexing: attribute + attribute: fast-search + } + struct-field value.weight { + indexing: attribute + } + } + field str_int_map type map<string, int> { + indexing: summary + struct-field key { + indexing: attribute + attribute: fast-search + } + struct-field value { + indexing: attribute + } + } + } +} diff --git a/config-model/src/test/derived/imported_struct_fields/summary.cfg b/config-model/src/test/derived/imported_struct_fields/summary.cfg new file mode 100644 index 00000000000..666da5bbc76 --- /dev/null +++ b/config-model/src/test/derived/imported_struct_fields/summary.cfg @@ -0,0 +1,31 @@ +defaultsummaryid 1570252291 +classes[0].id 1570252291 +classes[0].name "default" +classes[0].fields[0].name "parent_ref" +classes[0].fields[0].type "longstring" +classes[0].fields[1].name "rankfeatures" +classes[0].fields[1].type "featuredata" +classes[0].fields[2].name "summaryfeatures" +classes[0].fields[2].type "featuredata" +classes[0].fields[3].name "documentid" +classes[0].fields[3].type "longstring" +classes[1].id 2126652894 +classes[1].name "mysummary" +classes[1].fields[0].name "documentid" +classes[1].fields[0].type "longstring" +classes[1].fields[1].name "my_elem_array" +classes[1].fields[1].type "jsonstring" +classes[1].fields[2].name "my_elem_map" +classes[1].fields[2].type "jsonstring" +classes[1].fields[3].name "my_str_int_map" +classes[1].fields[3].type "jsonstring" +classes[1].fields[4].name "rankfeatures" +classes[1].fields[4].type "featuredata" +classes[1].fields[5].name "summaryfeatures" +classes[1].fields[5].type "featuredata" +classes[2].id 1274088866 +classes[2].name "attributeprefetch" +classes[2].fields[0].name "rankfeatures" +classes[2].fields[0].type "featuredata" +classes[2].fields[1].name "summaryfeatures" +classes[2].fields[1].type "featuredata"
\ No newline at end of file diff --git a/config-model/src/test/derived/imported_struct_fields/summarymap.cfg b/config-model/src/test/derived/imported_struct_fields/summarymap.cfg new file mode 100644 index 00000000000..0b869417aef --- /dev/null +++ b/config-model/src/test/derived/imported_struct_fields/summarymap.cfg @@ -0,0 +1,16 @@ +defaultoutputclass -1 +override[0].field "my_elem_array" +override[0].command "attributecombiner" +override[0].arguments "" +override[1].field "my_elem_map" +override[1].command "attributecombiner" +override[1].arguments "" +override[2].field "my_str_int_map" +override[2].command "attributecombiner" +override[2].arguments "" +override[3].field "rankfeatures" +override[3].command "rankfeatures" +override[3].arguments "" +override[4].field "summaryfeatures" +override[4].command "summaryfeatures" +override[4].arguments ""
\ No newline at end of file |