diff options
Diffstat (limited to 'container-search/src/test/java/com/yahoo')
5 files changed, 19 insertions, 10 deletions
diff --git a/container-search/src/test/java/com/yahoo/prelude/hitfield/test/JSONStringTestCase.java b/container-search/src/test/java/com/yahoo/prelude/hitfield/test/JSONStringTestCase.java index cafb79d8542..ca7d5bf6999 100644 --- a/container-search/src/test/java/com/yahoo/prelude/hitfield/test/JSONStringTestCase.java +++ b/container-search/src/test/java/com/yahoo/prelude/hitfield/test/JSONStringTestCase.java @@ -740,13 +740,6 @@ public class JSONStringTestCase { Inspector value5 = new JSONString("{\"foo\":1}").inspect(); Inspector value6 = new JSONString("[1,2,3]").inspect(); - System.out.println("1: " + value1); - System.out.println("2: " + value2); - System.out.println("3: " + value3); - System.out.println("4: " + value4); - System.out.println("5: " + value5); - System.out.println("6: " + value6); - assertEquals(Type.STRING, value1.type()); assertEquals("", value1.asString()); diff --git a/container-search/src/test/java/com/yahoo/prelude/query/ItemHelperTestCase.java b/container-search/src/test/java/com/yahoo/prelude/query/ItemHelperTestCase.java index 5b20eda4344..5e0da17c186 100644 --- a/container-search/src/test/java/com/yahoo/prelude/query/ItemHelperTestCase.java +++ b/container-search/src/test/java/com/yahoo/prelude/query/ItemHelperTestCase.java @@ -34,7 +34,6 @@ public class ItemHelperTestCase { ItemHelper helper = new ItemHelper(); Query q = new Query("/?query=" + enc("a b c \"d e\" -f")); List<IndexedItem> l = new ArrayList<>(); - System.out.println(q.getModel()); helper.getPositiveTerms(q.getModel().getQueryTree().getRoot(), l); assertEquals(4, l.size()); boolean a = false; diff --git a/container-search/src/test/java/com/yahoo/search/dispatch/TopKEstimatorTest.java b/container-search/src/test/java/com/yahoo/search/dispatch/TopKEstimatorTest.java index 4cd453746bb..2f36d174ad4 100644 --- a/container-search/src/test/java/com/yahoo/search/dispatch/TopKEstimatorTest.java +++ b/container-search/src/test/java/com/yahoo/search/dispatch/TopKEstimatorTest.java @@ -88,7 +88,7 @@ public class TopKEstimatorTest { @Test void requireThatLargeKAreSane() { - System.out.println(dumpProbability(10, 0.05)); + // System.out.println(dumpProbability(10, 0.05)); TopKEstimator idealEstimator = new TopKEstimator(30, 0.9999); TopKEstimator skewedEstimator = new TopKEstimator(30, 0.9999, 0.05); int [] K = {10, 20, 40, 80, 100, 200, 400, 800, 1000, 2000, 4000, 8000, 10000, 20000, 40000, 80000, 100000}; diff --git a/container-search/src/test/java/com/yahoo/search/query/profile/test/DumpToolTestCase.java b/container-search/src/test/java/com/yahoo/search/query/profile/test/DumpToolTestCase.java index 357bba0c7b1..7cbd5747d2d 100644 --- a/container-search/src/test/java/com/yahoo/search/query/profile/test/DumpToolTestCase.java +++ b/container-search/src/test/java/com/yahoo/search/query/profile/test/DumpToolTestCase.java @@ -25,7 +25,6 @@ public class DumpToolTestCase { @Test void testNoDimensionValues() { - System.out.println(new DumpTool().resolveAndDump("multiprofile1", profileDir)); assertTrue(new DumpTool().resolveAndDump("multiprofile1", profileDir).contains("a=general-a\n")); } diff --git a/container-search/src/test/java/com/yahoo/search/test/QueryTestCase.java b/container-search/src/test/java/com/yahoo/search/test/QueryTestCase.java index 6a310180eab..259a79b095b 100644 --- a/container-search/src/test/java/com/yahoo/search/test/QueryTestCase.java +++ b/container-search/src/test/java/com/yahoo/search/test/QueryTestCase.java @@ -306,6 +306,24 @@ public class QueryTestCase { assertEquals("Profile: myProfile", q.properties().get("myField")); } + /** Select is special handled due to the strange idea to also use it to contain subproperties with JSON. */ + @Test + void testQueryProfileWithSelect() { + String grouping = "all(group(customerid) each(output(count())))"; + + { // select in the request + QueryProfile profile = new QueryProfile("myProfile"); + Query q = new Query(QueryTestCase.httpEncode("/search?query=macbook&queryProfile=myProfile&select=" + grouping), profile.compile(null)); + assertEquals(grouping, q.getSelect().getGroupingExpressionString()); + } + { // select in the query profile + QueryProfile profile = new QueryProfile("myProfile"); + profile.set("select", grouping, null); + Query q = new Query(QueryTestCase.httpEncode("/search?query=macbook&queryProfile=myProfile"), profile.compile(null)); + assertEquals(grouping, q.getSelect().getGroupingExpressionString()); + } + } + @Test void testQueryProfileSourceAccess() { QueryProfile profile = new QueryProfile("myProfile"); |