use of com.yahoo.search.Query in project vespa by vespa-engine.
the class SoftTimeoutTestCase method testDefaultsInQuery.
@Test
public void testDefaultsInQuery() {
Query query = new Query("?query=test");
assertNull(query.getRanking().getSoftTimeout().getEnable());
assertNull(query.getRanking().getSoftTimeout().getFactor());
assertNull(query.getRanking().getSoftTimeout().getTailcost());
}
use of com.yahoo.search.Query in project vespa by vespa-engine.
the class XmlReadingTestCase method testNewsCase2.
@Test
public void testNewsCase2() {
CompiledQueryProfileRegistry registry = new QueryProfileXMLReader().read("src/test/java/com/yahoo/search/query/profile/config/test/newscase2").compile();
Query query;
query = new Query(HttpRequest.createTestRequest("?query=test&custid_1=parent", Method.GET), registry.getComponent("default"));
assertEquals("0.0", query.properties().get("a.features.b"));
assertEquals("0.0", query.properties().listProperties().get("a.features.b"));
query = new Query(HttpRequest.createTestRequest("?query=test&custid_1=parent&custid_2=child", Method.GET), registry.getComponent("default"));
assertEquals("0.1", query.properties().get("a.features.b"));
assertEquals("0.1", query.properties().listProperties().get("a.features.b"));
}
use of com.yahoo.search.Query in project vespa by vespa-engine.
the class XmlReadingTestCase method testNewsCase3.
@Test
public void testNewsCase3() {
CompiledQueryProfileRegistry registry = new QueryProfileXMLReader().read("src/test/java/com/yahoo/search/query/profile/config/test/newscase3").compile();
Query query;
query = new Query(HttpRequest.createTestRequest("?query=test&custid_1=parent", Method.GET), registry.getComponent("default"));
assertEquals("0.0", query.properties().get("a.features"));
query = new Query(HttpRequest.createTestRequest("?query=test&custid_1=parent&custid_2=child", Method.GET), registry.getComponent("default"));
assertEquals("0.1", query.properties().get("a.features"));
}
use of com.yahoo.search.Query in project vespa by vespa-engine.
the class XmlReadingTestCase method testBasicsWithProfile.
@Test
public void testBasicsWithProfile() {
QueryProfile p = new QueryProfile("default");
p.set("a", "foo", null);
Query q = new Query(HttpRequest.createTestRequest("?query=test", Method.GET), p.compile(null));
assertEquals("test", q.properties().get("query"));
assertEquals("test", q.properties().get("QueRY"));
assertEquals("test", q.properties().get("model.queryString"));
assertEquals("test", q.getModel().getQueryString());
}
use of com.yahoo.search.Query in project vespa by vespa-engine.
the class XmlReadingTestCase method testNewsCase1.
@Test
public void testNewsCase1() {
CompiledQueryProfileRegistry registry = new QueryProfileXMLReader().read("src/test/java/com/yahoo/search/query/profile/config/test/newscase1").compile();
Query query;
query = new Query(HttpRequest.createTestRequest("?query=test&custid_1=parent", Method.GET), registry.getComponent("default"));
assertEquals("0.0", query.properties().get("ranking.features.b"));
assertEquals("0.0", query.properties().listProperties().get("ranking.features.b"));
query = new Query(HttpRequest.createTestRequest("?query=test&custid_1=parent&custid_2=child", Method.GET), registry.getComponent("default"));
assertEquals("0.1", query.properties().get("ranking.features.b"));
assertEquals("0.1", query.properties().listProperties().get("ranking.features.b"));
}
Aggregations