diff options
author | Jon Bratseth <bratseth@gmail.com> | 2022-05-03 08:36:37 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2022-05-03 08:36:37 +0200 |
commit | 4ea84f4c4e220a0aca1396bb2a2d202f4a0df2c5 (patch) | |
tree | 00c30cc8408e59e48bb41c39126cb95f346d09bc | |
parent | 9e4c738e9e994124d96cede78449d2d558d4977f (diff) |
Test schema-info deriving
6 files changed, 194 insertions, 5 deletions
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/derived/DerivedConfiguration.java b/config-model/src/main/java/com/yahoo/searchdefinition/derived/DerivedConfiguration.java index 48bc972f7ef..f8c44797884 100644 --- a/config-model/src/main/java/com/yahoo/searchdefinition/derived/DerivedConfiguration.java +++ b/config-model/src/main/java/com/yahoo/searchdefinition/derived/DerivedConfiguration.java @@ -126,6 +126,7 @@ public class DerivedConfiguration implements AttributesConfig.Producer { indexingScript.export(toDirectory); indexInfo.export(toDirectory); importedFields.export(toDirectory); + schemaInfo.export(toDirectory); } } diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/derived/SchemaInfo.java b/config-model/src/main/java/com/yahoo/searchdefinition/derived/SchemaInfo.java index 3698345eb11..eeb3a97eda9 100644 --- a/config-model/src/main/java/com/yahoo/searchdefinition/derived/SchemaInfo.java +++ b/config-model/src/main/java/com/yahoo/searchdefinition/derived/SchemaInfo.java @@ -21,7 +21,7 @@ import java.util.Map; * * @author bratseth */ -public final class SchemaInfo implements SchemaInfoConfig.Producer { +public final class SchemaInfo extends Derived implements SchemaInfoConfig.Producer { private final Schema schema; @@ -42,6 +42,9 @@ public final class SchemaInfo implements SchemaInfoConfig.Producer { public String name() { return schema.getName(); } + @Override + public String getDerivedName() { return "schema-info"; } + public Schema fullSchema() { return schema; } public Map<String, RankProfileInfo> rankProfiles() { return rankProfiles; } diff --git a/config-model/src/test/derived/imported_position_field_summary/schema-info.cfg b/config-model/src/test/derived/imported_position_field_summary/schema-info.cfg new file mode 100644 index 00000000000..e4bd88e6ac9 --- /dev/null +++ b/config-model/src/test/derived/imported_position_field_summary/schema-info.cfg @@ -0,0 +1,40 @@ +schema[].name "child" +schema[].summaryclass[].name "default" +schema[].summaryclass[].fields[].name "parent_ref" +schema[].summaryclass[].fields[].type "longstring" +schema[].summaryclass[].fields[].dynamic false +schema[].summaryclass[].fields[].name "rankfeatures" +schema[].summaryclass[].fields[].type "featuredata" +schema[].summaryclass[].fields[].dynamic false +schema[].summaryclass[].fields[].name "summaryfeatures" +schema[].summaryclass[].fields[].type "featuredata" +schema[].summaryclass[].fields[].dynamic false +schema[].summaryclass[].fields[].name "my_pos" +schema[].summaryclass[].fields[].type "jsonstring" +schema[].summaryclass[].fields[].dynamic false +schema[].summaryclass[].fields[].name "documentid" +schema[].summaryclass[].fields[].type "longstring" +schema[].summaryclass[].fields[].dynamic false +schema[].summaryclass[].name "mysummary" +schema[].summaryclass[].fields[].name "my_pos" +schema[].summaryclass[].fields[].type "jsonstring" +schema[].summaryclass[].fields[].dynamic false +schema[].summaryclass[].fields[].name "rankfeatures" +schema[].summaryclass[].fields[].type "featuredata" +schema[].summaryclass[].fields[].dynamic false +schema[].summaryclass[].fields[].name "summaryfeatures" +schema[].summaryclass[].fields[].type "featuredata" +schema[].summaryclass[].fields[].dynamic false +schema[].summaryclass[].name "attributeprefetch" +schema[].summaryclass[].fields[].name "rankfeatures" +schema[].summaryclass[].fields[].type "featuredata" +schema[].summaryclass[].fields[].dynamic false +schema[].summaryclass[].fields[].name "summaryfeatures" +schema[].summaryclass[].fields[].type "featuredata" +schema[].summaryclass[].fields[].dynamic false +schema[].rankprofile[].name "default" +schema[].rankprofile[].hasSummaryFeatures false +schema[].rankprofile[].hasRankFeatures false +schema[].rankprofile[].name "unranked" +schema[].rankprofile[].hasSummaryFeatures false +schema[].rankprofile[].hasRankFeatures false diff --git a/config-model/src/test/derived/neuralnet_noqueryprofile/schema-info.cfg b/config-model/src/test/derived/neuralnet_noqueryprofile/schema-info.cfg new file mode 100644 index 00000000000..aa8bf1c7291 --- /dev/null +++ b/config-model/src/test/derived/neuralnet_noqueryprofile/schema-info.cfg @@ -0,0 +1,114 @@ +schema[].name "neuralnet" +schema[].summaryclass[].name "default" +schema[].summaryclass[].fields[].name "rankfeatures" +schema[].summaryclass[].fields[].type "featuredata" +schema[].summaryclass[].fields[].dynamic false +schema[].summaryclass[].fields[].name "summaryfeatures" +schema[].summaryclass[].fields[].type "featuredata" +schema[].summaryclass[].fields[].dynamic false +schema[].summaryclass[].fields[].name "documentid" +schema[].summaryclass[].fields[].type "longstring" +schema[].summaryclass[].fields[].dynamic false +schema[].summaryclass[].name "attributeprefetch" +schema[].summaryclass[].fields[].name "pinned" +schema[].summaryclass[].fields[].type "integer" +schema[].summaryclass[].fields[].dynamic false +schema[].summaryclass[].fields[].name "createdAt" +schema[].summaryclass[].fields[].type "int64" +schema[].summaryclass[].fields[].dynamic false +schema[].summaryclass[].fields[].name "updatedAt" +schema[].summaryclass[].fields[].type "int64" +schema[].summaryclass[].fields[].dynamic false +schema[].summaryclass[].fields[].name "uvCount" +schema[].summaryclass[].fields[].type "integer" +schema[].summaryclass[].fields[].dynamic false +schema[].summaryclass[].fields[].name "dvCount" +schema[].summaryclass[].fields[].type "integer" +schema[].summaryclass[].fields[].dynamic false +schema[].summaryclass[].fields[].name "aVoteCount" +schema[].summaryclass[].fields[].type "integer" +schema[].summaryclass[].fields[].dynamic false +schema[].summaryclass[].fields[].name "rCount" +schema[].summaryclass[].fields[].type "integer" +schema[].summaryclass[].fields[].dynamic false +schema[].summaryclass[].fields[].name "uniqueRACount" +schema[].summaryclass[].fields[].type "integer" +schema[].summaryclass[].fields[].dynamic false +schema[].summaryclass[].fields[].name "rTo" +schema[].summaryclass[].fields[].type "longstring" +schema[].summaryclass[].fields[].dynamic false +schema[].summaryclass[].fields[].name "markedAsAAt" +schema[].summaryclass[].fields[].type "int64" +schema[].summaryclass[].fields[].dynamic false +schema[].summaryclass[].fields[].name "normalizedTextScore" +schema[].summaryclass[].fields[].type "float" +schema[].summaryclass[].fields[].dynamic false +schema[].summaryclass[].fields[].name "t" +schema[].summaryclass[].fields[].type "float" +schema[].summaryclass[].fields[].dynamic false +schema[].summaryclass[].fields[].name "relevance" +schema[].summaryclass[].fields[].type "float" +schema[].summaryclass[].fields[].dynamic false +schema[].summaryclass[].fields[].name "normalizedCS" +schema[].summaryclass[].fields[].type "float" +schema[].summaryclass[].fields[].dynamic false +schema[].summaryclass[].fields[].name "laAt" +schema[].summaryclass[].fields[].type "int64" +schema[].summaryclass[].fields[].dynamic false +schema[].summaryclass[].fields[].name "hsScore" +schema[].summaryclass[].fields[].type "double" +schema[].summaryclass[].fields[].dynamic false +schema[].summaryclass[].fields[].name "rankfeatures" +schema[].summaryclass[].fields[].type "featuredata" +schema[].summaryclass[].fields[].dynamic false +schema[].summaryclass[].fields[].name "summaryfeatures" +schema[].summaryclass[].fields[].type "featuredata" +schema[].summaryclass[].fields[].dynamic false +schema[].rankprofile[].name "default" +schema[].rankprofile[].hasSummaryFeatures false +schema[].rankprofile[].hasRankFeatures false +schema[].rankprofile[].input[].name "query(W_0)" +schema[].rankprofile[].input[].type "tensor(hidden[9],x[9])" +schema[].rankprofile[].input[].name "query(b_0)" +schema[].rankprofile[].input[].type "tensor(hidden[9])" +schema[].rankprofile[].input[].name "query(W_1)" +schema[].rankprofile[].input[].type "tensor(hidden[9],out[9])" +schema[].rankprofile[].input[].name "query(b_1)" +schema[].rankprofile[].input[].type "tensor(out[9])" +schema[].rankprofile[].input[].name "query(W_out)" +schema[].rankprofile[].input[].type "tensor(out[9])" +schema[].rankprofile[].input[].name "query(b_out)" +schema[].rankprofile[].input[].type "tensor(out[1])" +schema[].rankprofile[].name "unranked" +schema[].rankprofile[].hasSummaryFeatures false +schema[].rankprofile[].hasRankFeatures false +schema[].rankprofile[].name "defaultRankProfile" +schema[].rankprofile[].hasSummaryFeatures false +schema[].rankprofile[].hasRankFeatures false +schema[].rankprofile[].input[].name "query(W_0)" +schema[].rankprofile[].input[].type "tensor(hidden[9],x[9])" +schema[].rankprofile[].input[].name "query(b_0)" +schema[].rankprofile[].input[].type "tensor(hidden[9])" +schema[].rankprofile[].input[].name "query(W_1)" +schema[].rankprofile[].input[].type "tensor(hidden[9],out[9])" +schema[].rankprofile[].input[].name "query(b_1)" +schema[].rankprofile[].input[].type "tensor(out[9])" +schema[].rankprofile[].input[].name "query(W_out)" +schema[].rankprofile[].input[].type "tensor(out[9])" +schema[].rankprofile[].input[].name "query(b_out)" +schema[].rankprofile[].input[].type "tensor(out[1])" +schema[].rankprofile[].name "neuralNetworkProfile" +schema[].rankprofile[].hasSummaryFeatures false +schema[].rankprofile[].hasRankFeatures false +schema[].rankprofile[].input[].name "query(W_0)" +schema[].rankprofile[].input[].type "tensor(hidden[9],x[9])" +schema[].rankprofile[].input[].name "query(b_0)" +schema[].rankprofile[].input[].type "tensor(hidden[9])" +schema[].rankprofile[].input[].name "query(W_1)" +schema[].rankprofile[].input[].type "tensor(hidden[9],out[9])" +schema[].rankprofile[].input[].name "query(b_1)" +schema[].rankprofile[].input[].type "tensor(out[9])" +schema[].rankprofile[].input[].name "query(W_out)" +schema[].rankprofile[].input[].type "tensor(out[9])" +schema[].rankprofile[].input[].name "query(b_out)" +schema[].rankprofile[].input[].type "tensor(out[1])" diff --git a/config-model/src/test/derived/rankprofilemodularity/schema-info.cfg b/config-model/src/test/derived/rankprofilemodularity/schema-info.cfg new file mode 100644 index 00000000000..86cbfa0562d --- /dev/null +++ b/config-model/src/test/derived/rankprofilemodularity/schema-info.cfg @@ -0,0 +1,35 @@ +schema[].name "test" +schema[].summaryclass[].name "default" +schema[].summaryclass[].fields[].name "rankfeatures" +schema[].summaryclass[].fields[].type "featuredata" +schema[].summaryclass[].fields[].dynamic false +schema[].summaryclass[].fields[].name "summaryfeatures" +schema[].summaryclass[].fields[].type "featuredata" +schema[].summaryclass[].fields[].dynamic false +schema[].summaryclass[].fields[].name "documentid" +schema[].summaryclass[].fields[].type "longstring" +schema[].summaryclass[].fields[].dynamic false +schema[].rankprofile[].name "default" +schema[].rankprofile[].hasSummaryFeatures false +schema[].rankprofile[].hasRankFeatures false +schema[].rankprofile[].name "unranked" +schema[].rankprofile[].hasSummaryFeatures false +schema[].rankprofile[].hasRankFeatures false +schema[].rankprofile[].name "in_schema0" +schema[].rankprofile[].hasSummaryFeatures false +schema[].rankprofile[].hasRankFeatures false +schema[].rankprofile[].name "in_schema1" +schema[].rankprofile[].hasSummaryFeatures false +schema[].rankprofile[].hasRankFeatures false +schema[].rankprofile[].name "in_schema2" +schema[].rankprofile[].hasSummaryFeatures false +schema[].rankprofile[].hasRankFeatures false +schema[].rankprofile[].name "in_schema3" +schema[].rankprofile[].hasSummaryFeatures false +schema[].rankprofile[].hasRankFeatures false +schema[].rankprofile[].name "outside_schema1" +schema[].rankprofile[].hasSummaryFeatures false +schema[].rankprofile[].hasRankFeatures false +schema[].rankprofile[].name "outside_schema2" +schema[].rankprofile[].hasSummaryFeatures false +schema[].rankprofile[].hasRankFeatures false diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/NeuralNetTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/NeuralNetTestCase.java index a1c39d299d2..c7b0d131eb6 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/derived/NeuralNetTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/NeuralNetTestCase.java @@ -32,10 +32,6 @@ public class NeuralNetTestCase extends AbstractExportingTestCase { public void testNeuralNet_noQueryProfiles() throws IOException, ParseException { ComponentId.resetGlobalCountersForTests(); DerivedConfiguration c = assertCorrectDeriving("neuralnet_noqueryprofile"); - // Verify that query profiles end up correct when passed through the same intermediate forms as a full system - CompiledQueryProfileRegistry queryProfiles = - QueryProfileConfigurer.createFromConfig(new QueryProfiles(c.getQueryProfiles(), (level, message) -> {}).getConfig()).compile(); - // assertNeuralNetQuery(c, queryProfiles.getComponent("default")); TODO } private void assertNeuralNetQuery(DerivedConfiguration c, CompiledQueryProfile defaultprofile) { |