aboutsummaryrefslogtreecommitdiffstats
path: root/container-search/src/test
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@gmail.com>2022-05-10 11:30:36 +0200
committerJon Bratseth <bratseth@gmail.com>2022-05-10 11:30:36 +0200
commit6c39a83954b809dd51065af6b6620ef861c30fa2 (patch)
tree0c507ca00a77ea1f5aca43da1c8c063b6a85094e /container-search/src/test
parent568fec4d32c409a92737af54d5e101deb730750a (diff)
Unalias prefixes only when appropriate
Diffstat (limited to 'container-search/src/test')
-rw-r--r--container-search/src/test/java/com/yahoo/search/test/QueryTestCase.java15
1 files changed, 12 insertions, 3 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 56acdb039a9..b3aeda65f4b 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
@@ -450,7 +450,8 @@ public class QueryTestCase {
testProfile.set("d","e", null);
testProfile.set("u","11", null);
testProfile.set("foo.bar", "wiz", null);
- Query q = new Query(QueryTestCase.httpEncode("?query=a:>5&a=b&traceLevel=5&sources=a,b&u=12&foo.bar2=wiz2&c.d=foo&queryProfile=test"),testProfile.compile(null));
+ Query q = new Query(QueryTestCase.httpEncode("?query=a:>5&a=b&traceLevel=5&sources=a,b&u=12&foo.bar2=wiz2&c.d=foo&queryProfile=test"),
+ testProfile.compile(null));
String trace = q.getContext(false).getTrace().toString();
String[] traceLines = trace.split("\n");
}
@@ -471,13 +472,21 @@ public class QueryTestCase {
}
@Test
- public void testSimpleQueryParsing () {
+ public void testSimpleQueryParsing() {
Query q = new Query("/search?query=foobar&offset=10&hits=20");
- assertEquals("foobar",q.getModel().getQueryTree().toString());
+ assertEquals("foobar", q.getModel().getQueryTree().toString());
assertEquals(10,q.getOffset());
assertEquals(20,q.getHits());
}
+ /** "input.*" is an alias for "ranking.feature.*", but just "input" is not */
+ @Test
+ public void testPrefixAlias() {
+ Query q = new Query("/search?query=foobar&input=foo",
+ new QueryProfile("test").compile(null));
+ assertEquals("foo", q.properties().get("input"));
+ }
+
/** Test that GET parameter names are case in-sensitive */
@Test
public void testGETParametersCase() {