diff options
author | Jon Bratseth <bratseth@verizonmedia.com> | 2019-10-18 10:38:25 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@verizonmedia.com> | 2019-10-18 10:38:25 +0200 |
commit | 4331d28a447b57d0918078897757540fa06354b7 (patch) | |
tree | b0ca96b8c0eacba862d4b9b6119d44a962f60e0c /container-search | |
parent | 74653a7dc74420f12d6a87b5ff54977450697b20 (diff) |
Add test
Diffstat (limited to 'container-search')
-rw-r--r-- | container-search/src/test/java/com/yahoo/search/test/QueryTestCase.java | 16 |
1 files changed, 16 insertions, 0 deletions
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 fd29f2c12fe..ac9c4e48eb3 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 @@ -34,6 +34,9 @@ import com.yahoo.search.query.QueryTree; import com.yahoo.search.query.SessionId; import com.yahoo.search.query.profile.QueryProfile; import com.yahoo.search.query.profile.QueryProfileRegistry; +import com.yahoo.search.query.profile.compiled.CompiledQueryProfile; +import com.yahoo.search.query.profile.compiled.CompiledQueryProfileRegistry; +import com.yahoo.search.query.profile.types.QueryProfileType; import com.yahoo.search.result.Hit; import com.yahoo.search.searchchain.Execution; import com.yahoo.yolean.Exceptions; @@ -931,6 +934,19 @@ public class QueryTestCase { assertEquals("myfield:\"it s fine\"", query.getModel().getQueryTree().toString()); } + @Test + public void testGroupingAndQueryProfileType() { + QueryProfileType type = new QueryProfileType("mytype"); + QueryProfile profile = new QueryProfile("default"); + profile.setType(type); + QueryProfileRegistry registry = new QueryProfileRegistry(); + registry.register(profile); + registry.getTypeRegistry().register(type); + CompiledQueryProfileRegistry cRegistry = registry.compile(); + Query query = new Query(httpEncode("?query=sddocname:sentence&select=all(group(context_id) max(10) each(each(output(summary()))))"), + cRegistry.findQueryProfile("default")); + } + private void assertDetectionText(String expectedDetectionText, String queryString, String ... indexSpecs) { Query q = new Query(httpEncode("/?query=" + queryString)); SearchDefinition sd = new SearchDefinition("testSearchDefinition"); |