diff options
author | Arne Juul <arnej@vespa.ai> | 2024-02-21 14:31:27 +0000 |
---|---|---|
committer | Arne Juul <arnej@vespa.ai> | 2024-02-22 10:36:19 +0000 |
commit | 97eff1f15dcafe4a8d0229fa36b3e0448de2f4d6 (patch) | |
tree | 7bfa620f51263b3e2c6cc1bd319b922a0cb33a09 /container-search/src/test/java/com | |
parent | 4f0947b6617f5c9ff0a133a1f12bb4a5b7d57bb6 (diff) |
allow inputs { query(foo) string }
Diffstat (limited to 'container-search/src/test/java/com')
-rw-r--r-- | container-search/src/test/java/com/yahoo/search/query/RankProfileInputTest.java | 15 | ||||
-rw-r--r-- | container-search/src/test/java/com/yahoo/search/schema/SchemaInfoTester.java | 17 |
2 files changed, 17 insertions, 15 deletions
diff --git a/container-search/src/test/java/com/yahoo/search/query/RankProfileInputTest.java b/container-search/src/test/java/com/yahoo/search/query/RankProfileInputTest.java index 2feac135b03..3cdfc95ea0e 100644 --- a/container-search/src/test/java/com/yahoo/search/query/RankProfileInputTest.java +++ b/container-search/src/test/java/com/yahoo/search/query/RankProfileInputTest.java @@ -7,6 +7,7 @@ import com.yahoo.language.process.Embedder; import com.yahoo.search.Query; import com.yahoo.search.schema.Cluster; import com.yahoo.search.schema.RankProfile; +import com.yahoo.search.schema.RankProfile.InputType; import com.yahoo.search.schema.Schema; import com.yahoo.search.schema.SchemaInfo; import com.yahoo.search.query.profile.QueryProfile; @@ -298,23 +299,23 @@ public class RankProfileInputTest { private SchemaInfo createSchemaInfo() { List<Schema> schemas = new ArrayList<>(); RankProfile.Builder common = new RankProfile.Builder("commonProfile") - .addInput("query(myTensor1)", TensorType.fromSpec("tensor(a{},b{})")) - .addInput("query(myTensor2)", TensorType.fromSpec("tensor(x[2],y[2])")) - .addInput("query(myTensor3)", TensorType.fromSpec("tensor(x[2],y[2])")) - .addInput("query(myTensor4)", TensorType.fromSpec("tensor<float>(x[5])")); + .addInput("query(myTensor1)", InputType.fromSpec("tensor(a{},b{})")) + .addInput("query(myTensor2)", InputType.fromSpec("tensor(x[2],y[2])")) + .addInput("query(myTensor3)", InputType.fromSpec("tensor(x[2],y[2])")) + .addInput("query(myTensor4)", InputType.fromSpec("tensor<float>(x[5])")); schemas.add(new Schema.Builder("a") .add(common.build()) .add(new RankProfile.Builder("inconsistent") - .addInput("query(myTensor1)", TensorType.fromSpec("tensor(a{},b{})")) + .addInput("query(myTensor1)", InputType.fromSpec("tensor(a{},b{})")) .build()) .build()); schemas.add(new Schema.Builder("b") .add(common.build()) .add(new RankProfile.Builder("inconsistent") - .addInput("query(myTensor1)", TensorType.fromSpec("tensor(x[10])")) + .addInput("query(myTensor1)", InputType.fromSpec("tensor(x[10])")) .build()) .add(new RankProfile.Builder("bOnly") - .addInput("query(myTensor1)", TensorType.fromSpec("tensor(a{},b{})")) + .addInput("query(myTensor1)", InputType.fromSpec("tensor(a{},b{})")) .build()) .build()); List<Cluster> clusters = new ArrayList<>(); diff --git a/container-search/src/test/java/com/yahoo/search/schema/SchemaInfoTester.java b/container-search/src/test/java/com/yahoo/search/schema/SchemaInfoTester.java index c27fe9ff15d..553f71d91b2 100644 --- a/container-search/src/test/java/com/yahoo/search/schema/SchemaInfoTester.java +++ b/container-search/src/test/java/com/yahoo/search/schema/SchemaInfoTester.java @@ -6,6 +6,7 @@ import com.yahoo.search.Query; import com.yahoo.search.config.IndexInfoConfig; import com.yahoo.search.config.SchemaInfoConfig; import com.yahoo.search.schema.RankProfile; +import com.yahoo.search.schema.RankProfile.InputType; import com.yahoo.search.schema.Schema; import com.yahoo.search.schema.SchemaInfo; import com.yahoo.tensor.TensorType; @@ -43,7 +44,7 @@ public class SchemaInfoTester { void assertInput(TensorType expectedType, String sources, String restrict, String rankProfile, String feature) { assertEquals(expectedType, - schemaInfo.newSession(query(sources, restrict)).rankProfileInput(feature, rankProfile)); + schemaInfo.newSession(query(sources, restrict)).rankProfileInput(feature, rankProfile).tensorType()); } void assertInputConflict(TensorType expectedType, String sources, String restrict, String rankProfile, String feature) { @@ -59,14 +60,14 @@ public class SchemaInfoTester { static SchemaInfo createSchemaInfo() { List<Schema> schemas = new ArrayList<>(); RankProfile.Builder common = new RankProfile.Builder("commonProfile") - .addInput("query(myTensor1)", TensorType.fromSpec("tensor(a{},b{})")) - .addInput("query(myTensor2)", TensorType.fromSpec("tensor(x[2],y[2])")) - .addInput("query(myTensor3)", TensorType.fromSpec("tensor(x[2],y[2])")) - .addInput("query(myTensor4)", TensorType.fromSpec("tensor<float>(x[5])")); + .addInput("query(myTensor1)", InputType.fromSpec("tensor(a{},b{})")) + .addInput("query(myTensor2)", InputType.fromSpec("tensor(x[2],y[2])")) + .addInput("query(myTensor3)", InputType.fromSpec("tensor(x[2],y[2])")) + .addInput("query(myTensor4)", InputType.fromSpec("tensor<float>(x[5])")); schemas.add(new Schema.Builder("a") .add(common.build()) .add(new RankProfile.Builder("inconsistent") - .addInput("query(myTensor1)", TensorType.fromSpec("tensor(a{},b{})")) + .addInput("query(myTensor1)", InputType.fromSpec("tensor(a{},b{})")) .build()) .add(new DocumentSummary.Builder("testSummary") .add(new DocumentSummary.Field("field1", "string")) @@ -77,10 +78,10 @@ public class SchemaInfoTester { schemas.add(new Schema.Builder("b") .add(common.build()) .add(new RankProfile.Builder("inconsistent") - .addInput("query(myTensor1)", TensorType.fromSpec("tensor(x[10])")) + .addInput("query(myTensor1)", InputType.fromSpec("tensor(x[10])")) .build()) .add(new RankProfile.Builder("bOnly") - .addInput("query(myTensor1)", TensorType.fromSpec("tensor(a{},b{})")) + .addInput("query(myTensor1)", InputType.fromSpec("tensor(a{},b{})")) .build()) .build()); List<Cluster> clusters = new ArrayList<>(); |