use of com.yahoo.prelude.searcher.PosSearcher in project vespa by vespa-engine.
the class PosSearcherTestCase method testNotOverridingOldStyleParameters.
@Test
public void testNotOverridingOldStyleParameters() {
PosSearcher searcher = new PosSearcher();
Query q = new Query("?query=test&pos.ll=N10.15;E6.08&location=(2,-1100222,0,300,0,1,0,CalcLatLon)");
q.setTraceLevel(1);
doSearch(searcher, q, 0, 10);
assertEquals("(2,-1100222,0,300,0,1,0,4294967295)", q.getRanking().getLocation().toString());
}
use of com.yahoo.prelude.searcher.PosSearcher in project vespa by vespa-engine.
the class PosSearcherTestCase method testInvalidInput.
/**
* Tests input parameters that should report errors.
*/
@Test
public void testInvalidInput() {
PosSearcher searcher = new PosSearcher();
Result result;
Query q = new Query();
q.properties().set("pos.ll", "NE74.14;E14.48");
result = doSearch(searcher, q, 0, 10);
assertEquals("Error in pos parameters: Unable to parse lat/long string 'NE74.14;E14.48': already set direction once, cannot add direction: E", ((ErrorHit) result.hits().get(0)).errors().iterator().next().getDetailedMessage());
q = new Query();
q.properties().set("pos.ll", "NE74.14;E14.48");
q.properties().set("pos.xy", "82400, 72800");
result = doSearch(searcher, q, 0, 10);
assertEquals("Error in pos parameters: Cannot handle both lat/long and xy coords at the same time", ((ErrorHit) result.hits().get(0)).errors().iterator().next().getDetailedMessage());
}
Aggregations