diff options
author | Jon Bratseth <bratseth@oath.com> | 2019-04-04 08:49:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-04 08:49:06 +0200 |
commit | f6e6d076a237bc5d08cf618a8caa2a683b3c78e6 (patch) | |
tree | 001e4d544e7e8354c163a44f8eb5c8d4e4e497d9 /container-search | |
parent | c8c842d622eb744504fe0b7b15044602b85ec0ee (diff) | |
parent | 8c23296c0feb1c418706f847c7b78ae926180859 (diff) |
Merge pull request #9003 from vespa-engine/bratseth/tensor-value-type
Bratseth/tensor value type
Diffstat (limited to 'container-search')
2 files changed, 26 insertions, 25 deletions
diff --git a/container-search/src/test/java/com/yahoo/search/query/profile/types/test/QueryProfileTypeTestCase.java b/container-search/src/test/java/com/yahoo/search/query/profile/types/test/QueryProfileTypeTestCase.java index 8eaf4cc08cb..c05c3589a30 100644 --- a/container-search/src/test/java/com/yahoo/search/query/profile/types/test/QueryProfileTypeTestCase.java +++ b/container-search/src/test/java/com/yahoo/search/query/profile/types/test/QueryProfileTypeTestCase.java @@ -77,7 +77,7 @@ public class QueryProfileTypeTestCase { type.addField(new FieldDescription("myBoolean", FieldType.fromString("boolean", registry)), registry); type.addField(new FieldDescription("ranking.features.query(myTensor1)", FieldType.fromString("tensor(a{},b{})", registry)), registry); type.addField(new FieldDescription("ranking.features.query(myTensor2)", FieldType.fromString("tensor(x[2],y[2])", registry)), registry); - type.addField(new FieldDescription("ranking.features.query(myTensor3)", FieldType.fromString("tensor(x{})",registry)), registry); + type.addField(new FieldDescription("ranking.features.query(myTensor3)", FieldType.fromString("tensor<float>(x{})",registry)), registry); type.addField(new FieldDescription("myQuery", FieldType.fromString("query", registry)), registry); type.addField(new FieldDescription("myQueryProfile", FieldType.fromString("query-profile", registry),"qp"), registry); } @@ -136,7 +136,7 @@ public class QueryProfileTypeTestCase { assertEquals(true, properties.get("myBoolean")); assertEquals(Tensor.from(tensorString1), properties.get("ranking.features.query(myTensor1)")); assertEquals(Tensor.from("tensor(x[2],y[2])", tensorString2), properties.get("ranking.features.query(myTensor2)")); - assertEquals(Tensor.from("tensor(x{})", tensorString3), properties.get("ranking.features.query(myTensor3)")); + assertEquals(Tensor.from("tensor<float>(x{})", tensorString3), properties.get("ranking.features.query(myTensor3)")); // TODO: assertEquals(..., cprofile.get("myQuery")); assertEquals("value1", properties.get("myQueryProfile.anyString")); assertEquals("value1", properties.get("QP.anyString")); diff --git a/container-search/src/test/java/com/yahoo/search/yql/UserInputTestCase.java b/container-search/src/test/java/com/yahoo/search/yql/UserInputTestCase.java index 3fa7f1ee47e..b5c4166e4de 100644 --- a/container-search/src/test/java/com/yahoo/search/yql/UserInputTestCase.java +++ b/container-search/src/test/java/com/yahoo/search/yql/UserInputTestCase.java @@ -3,6 +3,7 @@ package com.yahoo.search.yql; import static org.junit.Assert.*; +import com.yahoo.search.query.QueryTree; import org.apache.http.client.utils.URIBuilder; import org.junit.After; import org.junit.Before; @@ -29,20 +30,20 @@ public class UserInputTestCase { @Before public void setUp() throws Exception { - searchChain = new Chain<Searcher>(new MinimalQueryInserter()); + searchChain = new Chain<>(new MinimalQueryInserter()); context = Execution.Context.createContextStub(null); execution = new Execution(searchChain, context); } @After - public void tearDown() throws Exception { + public void tearDown() { searchChain = null; context = null; execution = null; } @Test - public final void testSimpleUserInput() { + public void testSimpleUserInput() { { URIBuilder builder = searchUri(); builder.setParameter("yql", @@ -70,7 +71,7 @@ public class UserInputTestCase { } @Test - public final void testRawUserInput() { + public void testRawUserInput() { URIBuilder builder = searchUri(); builder.setParameter("yql", "select * from sources * where [{\"grammar\": \"raw\"}]userInput(\"nal le\");"); @@ -79,7 +80,7 @@ public class UserInputTestCase { } @Test - public final void testSegmentedUserInput() { + public void testSegmentedUserInput() { URIBuilder builder = searchUri(); builder.setParameter("yql", "select * from sources * where [{\"grammar\": \"segment\"}]userInput(\"nal le\");"); @@ -88,7 +89,7 @@ public class UserInputTestCase { } @Test - public final void testSegmentedNoiseUserInput() { + public void testSegmentedNoiseUserInput() { URIBuilder builder = searchUri(); builder.setParameter("yql", "select * from sources * where [{\"grammar\": \"segment\"}]userInput(\"^^^^^^^^\");"); @@ -97,7 +98,7 @@ public class UserInputTestCase { } @Test - public final void testCustomDefaultIndexUserInput() { + public void testCustomDefaultIndexUserInput() { URIBuilder builder = searchUri(); builder.setParameter("yql", "select * from sources * where [{\"defaultIndex\": \"glompf\"}]userInput(\"nalle\");"); @@ -106,7 +107,7 @@ public class UserInputTestCase { } @Test - public final void testAnnotatedUserInputStemming() { + public void testAnnotatedUserInputStemming() { URIBuilder builder = searchUri(); builder.setParameter("yql", "select * from sources * where [{\"stem\": false}]userInput(\"nalle\");"); @@ -117,7 +118,7 @@ public class UserInputTestCase { } @Test - public final void testAnnotatedUserInputUnrankedTerms() { + public void testAnnotatedUserInputUnrankedTerms() { URIBuilder builder = searchUri(); builder.setParameter("yql", "select * from sources * where [{\"ranked\": false}]userInput(\"nalle\");"); @@ -128,7 +129,7 @@ public class UserInputTestCase { } @Test - public final void testAnnotatedUserInputFiltersTerms() { + public void testAnnotatedUserInputFiltersTerms() { URIBuilder builder = searchUri(); builder.setParameter("yql", "select * from sources * where [{\"filter\": true}]userInput(\"nalle\");"); @@ -139,7 +140,7 @@ public class UserInputTestCase { } @Test - public final void testAnnotatedUserInputCaseNormalization() { + public void testAnnotatedUserInputCaseNormalization() { URIBuilder builder = searchUri(); builder.setParameter( "yql", @@ -151,7 +152,7 @@ public class UserInputTestCase { } @Test - public final void testAnnotatedUserInputAccentRemoval() { + public void testAnnotatedUserInputAccentRemoval() { URIBuilder builder = searchUri(); builder.setParameter("yql", "select * from sources * where [{\"accentDrop\": false}]userInput(\"nalle\");"); @@ -162,7 +163,7 @@ public class UserInputTestCase { } @Test - public final void testAnnotatedUserInputPositionData() { + public void testAnnotatedUserInputPositionData() { URIBuilder builder = searchUri(); builder.setParameter("yql", "select * from sources * where [{\"usePositionData\": false}]userInput(\"nalle\");"); @@ -173,7 +174,7 @@ public class UserInputTestCase { } @Test - public final void testQueryPropertiesAsStringArguments() { + public void testQueryPropertiesAsStringArguments() { URIBuilder builder = searchUri(); builder.setParameter("nalle", "bamse"); builder.setParameter("meta", "syntactic"); @@ -197,7 +198,7 @@ public class UserInputTestCase { } @Test - public final void testEmptyUserInput() { + public void testEmptyUserInput() { URIBuilder builder = searchUri(); builder.setParameter("yql", "select * from sources * where userInput(\"\");"); @@ -205,7 +206,7 @@ public class UserInputTestCase { } @Test - public final void testEmptyUserInputFromQueryProperty() { + public void testEmptyUserInputFromQueryProperty() { URIBuilder builder = searchUri(); builder.setParameter("foo", ""); builder.setParameter("yql", @@ -214,7 +215,7 @@ public class UserInputTestCase { } @Test - public final void testEmptyQueryProperty() { + public void testEmptyQueryProperty() { URIBuilder builder = searchUri(); builder.setParameter("foo", ""); builder.setParameter("yql", "select * from sources * where bar contains \"a\" and nonEmpty(foo contains @foo);"); @@ -222,7 +223,7 @@ public class UserInputTestCase { } @Test - public final void testEmptyQueryPropertyInsideExpression() { + public void testEmptyQueryPropertyInsideExpression() { URIBuilder builder = searchUri(); builder.setParameter("foo", ""); builder.setParameter("yql", @@ -231,7 +232,7 @@ public class UserInputTestCase { } @Test - public final void testCompositeWithoutArguments() { + public void testCompositeWithoutArguments() { URIBuilder builder = searchUri(); builder.setParameter("yql", "select * from sources * where bar contains \"a\" and foo contains phrase();"); searchAndAssertNoErrors(builder); @@ -241,7 +242,7 @@ public class UserInputTestCase { } @Test - public final void testAnnoyingPlacementOfNonEmpty() { + public void testAnnoyingPlacementOfNonEmpty() { URIBuilder builder = searchUri(); builder.setParameter("yql", "select * from sources * where bar contains \"a\" and foo contains nonEmpty(phrase(\"a\", \"b\"));"); @@ -254,7 +255,7 @@ public class UserInputTestCase { } @Test - public final void testAllowEmptyUserInput() { + public void testAllowEmptyUserInput() { URIBuilder builder = searchUri(); builder.setParameter("foo", ""); builder.setParameter("yql", "select * from sources * where [{\"allowEmpty\": true}]userInput(@foo);"); @@ -262,7 +263,7 @@ public class UserInputTestCase { } @Test - public final void testAllowEmptyNullFromQueryParsing() { + public void testAllowEmptyNullFromQueryParsing() { URIBuilder builder = searchUri(); builder.setParameter("foo", ",,,,,,,,"); builder.setParameter("yql", "select * from sources * where [{\"allowEmpty\": true}]userInput(@foo);"); @@ -270,7 +271,7 @@ public class UserInputTestCase { } @Test - public final void testDisallowEmptyNullFromQueryParsing() { + public void testDisallowEmptyNullFromQueryParsing() { URIBuilder builder = searchUri(); builder.setParameter("foo", ",,,,,,,,"); builder.setParameter("yql", "select * from sources * where userInput(@foo);"); |