summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@gmail.com>2022-11-14 13:06:14 +0100
committerJon Bratseth <bratseth@gmail.com>2022-11-14 13:06:14 +0100
commit9dd3382f2370f42f1d1d3d781fe7ec51354b2e69 (patch)
treef7b581ccd189f8587169271a0b81cb145dab956f
parent399b271622dc80a67cf01906b7e863ee1bac12be (diff)
Test the MS marco notebook app application package
-rw-r--r--config-model/src/main/java/com/yahoo/schema/document/MatchAlgorithm.java6
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/application/validation/RankSetupValidator.java2
-rw-r--r--config-model/src/test/java/com/yahoo/schema/SchemaTestCase.java44
3 files changed, 49 insertions, 3 deletions
diff --git a/config-model/src/main/java/com/yahoo/schema/document/MatchAlgorithm.java b/config-model/src/main/java/com/yahoo/schema/document/MatchAlgorithm.java
index 8556fe491d0..f4ef5893279 100644
--- a/config-model/src/main/java/com/yahoo/schema/document/MatchAlgorithm.java
+++ b/config-model/src/main/java/com/yahoo/schema/document/MatchAlgorithm.java
@@ -2,15 +2,17 @@
package com.yahoo.schema.document;
/** Which match algorithm is used by this matching setup */
-
public enum MatchAlgorithm {
+
NORMAL("normal"),
PREFIX("prefix"),
SUBSTRING("substring"),
SUFFIX("suffix");
- private String name;
+ private final String name;
+
MatchAlgorithm(String name) { this.name = name; }
public String getName() { return name; }
+
}
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/RankSetupValidator.java b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/RankSetupValidator.java
index 276092e61f4..2230f2df71d 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/RankSetupValidator.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/RankSetupValidator.java
@@ -64,7 +64,7 @@ public class RankSetupValidator extends Validator {
".")
.toFile();
for (SearchCluster cluster : model.getSearchClusters()) {
- // Skipping rannking expression checking for streaming clusters, not implemented yet
+ // Skipping ranking expression checking for streaming clusters, not implemented yet
if (cluster.isStreaming()) continue;
IndexedSearchCluster sc = (IndexedSearchCluster) cluster;
diff --git a/config-model/src/test/java/com/yahoo/schema/SchemaTestCase.java b/config-model/src/test/java/com/yahoo/schema/SchemaTestCase.java
index 54e47dea6bb..366c78e22c6 100644
--- a/config-model/src/test/java/com/yahoo/schema/SchemaTestCase.java
+++ b/config-model/src/test/java/com/yahoo/schema/SchemaTestCase.java
@@ -68,6 +68,50 @@ public class SchemaTestCase {
}
@Test
+ void testOnnxModelWithColonInput() throws Exception {
+ String schema =
+ """
+ schema msmarco {
+ document msmarco {
+ field id type string {
+ indexing: summary | attribute
+ }
+ field text type string {
+ indexing: summary | index
+ }
+ }
+ onnx-model ltr_tensorflow {
+ file: files/ltr_tensorflow.onnx
+ input input:0: vespa_input
+ output dense: dense
+ }
+ rank-profile tensorflow {
+ function vespa_input() {
+ expression {
+ tensor<float>(x[1],y[3]):[[fieldMatch(text).queryCompleteness, fieldMatch(text).significance, nativeRank(text)]]
+ }
+ }
+ first-phase {
+ expression: sum(onnx(ltr_tensorflow).dense)
+ }
+ summary-features {
+ onnx(ltr_tensorflow)
+ fieldMatch(text).queryCompleteness
+ fieldMatch(text).significance
+ nativeRank(text)
+ }
+ }
+ }""";
+ ApplicationBuilder builder = new ApplicationBuilder(new DeployLoggerStub());
+ builder.processorsToSkip().add(OnnxModelTypeResolver.class); // Avoid discovering the Onnx model referenced does not exist
+ builder.addSchema(schema);
+ var application = builder.build(true);
+ var input = application.schemas().get("msmarco").onnxModels().get("ltr_tensorflow").getInputMap().get("input:0");
+ assertNotNull(input);
+ assertEquals("vespa_input", input);
+ }
+
+ @Test
void testSchemaInheritance() throws ParseException {
String parentLines = joinLines(
"schema parent {" +