diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-05-05 08:39:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-05 08:39:56 +0200 |
commit | 8897c6d30b5d3aef02e78ff70c157142c79486ee (patch) | |
tree | b2ae9941022d0eea4195956e8e7c514ba43238b1 /config-model | |
parent | 114ab74d2255412148fd64f670c90af0f159383b (diff) | |
parent | 4ea84f4c4e220a0aca1396bb2a2d202f4a0df2c5 (diff) |
Merge pull request #22399 from vespa-engine/bratseth/schema-info-4
Test schema-info deriving
Diffstat (limited to 'config-model')
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 77d742c63e9..0c7c507f32d 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 @@ -128,6 +128,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) { |