diff options
author | Tor Egge <Tor.Egge@online.no> | 2023-11-17 16:08:04 +0100 |
---|---|---|
committer | Tor Egge <Tor.Egge@online.no> | 2023-11-17 16:08:04 +0100 |
commit | b8205be37a08d3f6bc499a8252d410394555e1bb (patch) | |
tree | 31b6f4b8da4c080e342a3b74af10d719c4d300a4 /container-search/src/test/java/com/yahoo/search/yql/VespaSerializerTestCase.java | |
parent | b0ff93e170cdd38f1bc1b38b756a428c4e0726ca (diff) |
Add InItem to com.yahoo.prelude.query.
Diffstat (limited to 'container-search/src/test/java/com/yahoo/search/yql/VespaSerializerTestCase.java')
-rw-r--r-- | container-search/src/test/java/com/yahoo/search/yql/VespaSerializerTestCase.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/container-search/src/test/java/com/yahoo/search/yql/VespaSerializerTestCase.java b/container-search/src/test/java/com/yahoo/search/yql/VespaSerializerTestCase.java index f3612c3f303..6aac2faa4e9 100644 --- a/container-search/src/test/java/com/yahoo/search/yql/VespaSerializerTestCase.java +++ b/container-search/src/test/java/com/yahoo/search/yql/VespaSerializerTestCase.java @@ -1,6 +1,10 @@ // Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.search.yql; +import com.yahoo.prelude.Index; +import com.yahoo.prelude.IndexFacts; +import com.yahoo.prelude.IndexModel; +import com.yahoo.prelude.SearchDefinition; import com.yahoo.prelude.query.SameElementItem; import com.yahoo.search.Query; import com.yahoo.search.grouping.Continuation; @@ -43,6 +47,15 @@ public class VespaSerializerTestCase { parser = null; } + static private IndexFacts createIndexFactsForInTest() { + SearchDefinition sd = new SearchDefinition("sourceA"); + sd.addIndex(new Index("field")); + Index stringIndex = new Index("string"); + stringIndex.setString(true); + sd.addIndex(stringIndex); + return new IndexFacts(new IndexModel(sd)); + } + @Test void requireThatGroupingRequestsAreSerialized() { Query query = new Query(); @@ -451,4 +464,11 @@ public class VespaSerializerTestCase { parseAndConfirm("foo contains ({maxEditDistance:3,prefixLength:5}fuzzy(\"a\"))"); } + @Test + void testIn() { + parser = new YqlParser(new ParserEnvironment().setIndexFacts(createIndexFactsForInTest())); + parseAndConfirm("field in (2, 3)"); + parseAndConfirm("field in (9000000000L, 12000000000L)"); + parseAndConfirm("string in (\"a\", \"b\")"); + } } |