summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLester Solbakken <lesters@users.noreply.github.com>2022-05-16 09:40:15 +0200
committerGitHub <noreply@github.com>2022-05-16 09:40:15 +0200
commit212fc133b69654730a44d327ed8143682100b5d7 (patch)
tree74c80a884b3aa346221529553aaa9d6f71ac4052
parentbbe92324857195e87affc35235218c9417ec415a (diff)
parent1d4e2b9f9c3c2fbe4ab39e1f9c07c459f607f915 (diff)
Merge pull request #22608 from vespa-engine/bratseth/defaults-with-type
Output defaults with type
-rw-r--r--config-model/src/main/java/com/yahoo/searchdefinition/derived/RawRankProfile.java2
-rw-r--r--config-model/src/test/derived/neuralnet_noqueryprofile/rank-profiles.cfg6
-rw-r--r--config-model/src/test/java/com/yahoo/vespa/model/search/test/SchemaInfoTestCase.java10
3 files changed, 9 insertions, 9 deletions
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/derived/RawRankProfile.java b/config-model/src/main/java/com/yahoo/searchdefinition/derived/RawRankProfile.java
index 7b70e818e0f..2189d9d97db 100644
--- a/config-model/src/main/java/com/yahoo/searchdefinition/derived/RawRankProfile.java
+++ b/config-model/src/main/java/com/yahoo/searchdefinition/derived/RawRankProfile.java
@@ -440,7 +440,7 @@ public class RawRankProfile implements RankProfilesConfig.Producer {
properties.add(new Pair<>(input.name().toString(),
input.type().rank() == 0 ?
String.valueOf(input.defaultValue().get().asDouble()) :
- input.defaultValue().get().toString(false, false)));
+ input.defaultValue().get().toString(true, false)));
}
}
if (properties.size() >= 1000000) throw new IllegalArgumentException("Too many rank properties");
diff --git a/config-model/src/test/derived/neuralnet_noqueryprofile/rank-profiles.cfg b/config-model/src/test/derived/neuralnet_noqueryprofile/rank-profiles.cfg
index cd3abcb6028..7097eca266f 100644
--- a/config-model/src/test/derived/neuralnet_noqueryprofile/rank-profiles.cfg
+++ b/config-model/src/test/derived/neuralnet_noqueryprofile/rank-profiles.cfg
@@ -12,7 +12,7 @@ rankprofile[].fef.property[].value "tensor(out[9])"
rankprofile[].fef.property[].name "vespa.type.query.b_out"
rankprofile[].fef.property[].value "tensor(out[1])"
rankprofile[].fef.property[].name "query(b_out)"
-rankprofile[].fef.property[].value "{{out:0}:1.0}"
+rankprofile[].fef.property[].value "tensor(out[1]):{{out:0}:1.0}"
rankprofile[].name "unranked"
rankprofile[].fef.property[].name "vespa.rank.firstphase"
rankprofile[].fef.property[].value "value(0)"
@@ -84,7 +84,7 @@ rankprofile[].fef.property[].value "tensor(out[9])"
rankprofile[].fef.property[].name "vespa.type.query.b_out"
rankprofile[].fef.property[].value "tensor(out[1])"
rankprofile[].fef.property[].name "query(b_out)"
-rankprofile[].fef.property[].value "{{out:0}:1.0}"
+rankprofile[].fef.property[].value "tensor(out[1]):{{out:0}:1.0}"
rankprofile[].name "neuralNetworkProfile"
rankprofile[].fef.property[].name "rankingExpression(freshnessRank).rankingScript"
rankprofile[].fef.property[].value "nativeRank + freshness(createdAt)"
@@ -189,4 +189,4 @@ rankprofile[].fef.property[].value "tensor(out[9])"
rankprofile[].fef.property[].name "vespa.type.query.b_out"
rankprofile[].fef.property[].value "tensor(out[1])"
rankprofile[].fef.property[].name "query(b_out)"
-rankprofile[].fef.property[].value "{{out:0}:1.0}"
+rankprofile[].fef.property[].value "tensor(out[1]):{{out:0}:1.0}"
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/search/test/SchemaInfoTestCase.java b/config-model/src/test/java/com/yahoo/vespa/model/search/test/SchemaInfoTestCase.java
index cf2135aea5a..34afca703e9 100644
--- a/config-model/src/test/java/com/yahoo/vespa/model/search/test/SchemaInfoTestCase.java
+++ b/config-model/src/test/java/com/yahoo/vespa/model/search/test/SchemaInfoTestCase.java
@@ -65,11 +65,11 @@ public class SchemaInfoTestCase {
assertInput("query(bar)", "tensor(key{},x[1000])", null, 1, schemaInfoProfile, rankProfilesProfile);
assertInput("query(myDouble1)", "tensor()", "0.5", 2, schemaInfoProfile, rankProfilesProfile);
assertInput("query(myDouble2)", "tensor()", null, 3, schemaInfoProfile, rankProfilesProfile);
- assertInput("query(myMap)", "tensor(key{})", "{{key:label1}:1.0, {key:label2}:2.0, {key:label3}:3.0}", 4, schemaInfoProfile, rankProfilesProfile);
- assertInput("query(myVector)", "tensor(x[3])", "{{x:0}:1.0, {x:1}:2.0, {x:2}:3.0}", 5, schemaInfoProfile, rankProfilesProfile);
- assertInput("query(myMatrix)", "tensor(x[2],y[3])", "{{x:0,y:0}:1.0, {x:0,y:1}:2.0, {x:0,y:2}:3.0, {x:1,y:0}:4.0, {x:1,y:1}:5.0, {x:1,y:2}:6.0}", 6, schemaInfoProfile, rankProfilesProfile);
- assertInput("query(myMixed1)", "tensor(key{},x[2])", "{{key:key1,x:0}:-1.0, {key:key1,x:1}:1.1, {key:key2,x:0}:1.0, {key:key2,x:1}:2.0}", 7, schemaInfoProfile, rankProfilesProfile);
- assertInput("query(myMixed2)", "tensor(k1{},k2{},x[2])", "{{k1:l1,k2:l1,x:0}:-1.0, {k1:l1,k2:l1,x:1}:1.1, {k1:l1,k2:l2,x:0}:1.0, {k1:l1,k2:l2,x:1}:2.0}", 8, schemaInfoProfile, rankProfilesProfile);
+ assertInput("query(myMap)", "tensor(key{})", "tensor(key{}):{{key:label1}:1.0, {key:label2}:2.0, {key:label3}:3.0}", 4, schemaInfoProfile, rankProfilesProfile);
+ assertInput("query(myVector)", "tensor(x[3])", "tensor(x[3]):{{x:0}:1.0, {x:1}:2.0, {x:2}:3.0}", 5, schemaInfoProfile, rankProfilesProfile);
+ assertInput("query(myMatrix)", "tensor(x[2],y[3])", "tensor(x[2],y[3]):{{x:0,y:0}:1.0, {x:0,y:1}:2.0, {x:0,y:2}:3.0, {x:1,y:0}:4.0, {x:1,y:1}:5.0, {x:1,y:2}:6.0}", 6, schemaInfoProfile, rankProfilesProfile);
+ assertInput("query(myMixed1)", "tensor(key{},x[2])", "tensor(key{},x[2]):{{key:key1,x:0}:-1.0, {key:key1,x:1}:1.1, {key:key2,x:0}:1.0, {key:key2,x:1}:2.0}", 7, schemaInfoProfile, rankProfilesProfile);
+ assertInput("query(myMixed2)", "tensor(k1{},k2{},x[2])", "tensor(k1{},k2{},x[2]):{{k1:l1,k2:l1,x:0}:-1.0, {k1:l1,k2:l1,x:1}:1.1, {k1:l1,k2:l2,x:0}:1.0, {k1:l1,k2:l2,x:1}:2.0}", 8, schemaInfoProfile, rankProfilesProfile);
assertEquals(2, schema.summaryclass().size());
assertEquals("default", schema.summaryclass(0).name());