aboutsummaryrefslogtreecommitdiffstats
path: root/container-search/src/test/java/com
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-08-15 17:42:02 +0200
committerGitHub <noreply@github.com>2022-08-15 17:42:02 +0200
commit480295e5bbabb06ff61130eac6f4b6eeefc8a14e (patch)
tree0b2d367878eefb8ca04724f7b4658d57715a8272 /container-search/src/test/java/com
parentaa89c25d0ed2e8b0390ef62c6e55feecdd4c7815 (diff)
Revert "Added defaultIndex processing for userInput items parsing"
Diffstat (limited to 'container-search/src/test/java/com')
-rw-r--r--container-search/src/test/java/com/yahoo/search/yql/UserInputTestCase.java33
1 files changed, 1 insertions, 32 deletions
diff --git a/container-search/src/test/java/com/yahoo/search/yql/UserInputTestCase.java b/container-search/src/test/java/com/yahoo/search/yql/UserInputTestCase.java
index 1e3b52c23af..8fe451dd095 100644
--- a/container-search/src/test/java/com/yahoo/search/yql/UserInputTestCase.java
+++ b/container-search/src/test/java/com/yahoo/search/yql/UserInputTestCase.java
@@ -3,10 +3,7 @@ package com.yahoo.search.yql;
import static org.junit.jupiter.api.Assertions.*;
-import com.yahoo.prelude.Index;
-import com.yahoo.prelude.IndexFacts;
-import com.yahoo.prelude.IndexModel;
-import com.yahoo.prelude.SearchDefinition;
+import com.yahoo.search.query.QueryTree;
import org.apache.http.client.utils.URIBuilder;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
@@ -370,32 +367,4 @@ public class UserInputTestCase {
assertEquals("select * from sources * where text_field contains \"boom\"", query.yqlRepresentation());
}
- @Test
- void testUserInputWithPhraseSegmentingIndex() {
- execution = new Execution(searchChain, Execution.Context.createContextStub(createIndexFacts(true)));
- URIBuilder builder = searchUri();
- builder.setParameter("wql", "foo&bar");
- builder.setParameter("yql", "select * from sources * where ([{\"defaultIndex\": \"text_field\",\"grammar\": \"any\"}]userInput(@wql))");
- Query query = searchAndAssertNoErrors(builder);
- assertEquals("select * from sources * where text_field contains phrase(\"foo\", \"bar\")", query.yqlRepresentation());
- }
-
- @Test
- void testUserInputWithNonPhraseSegmentingIndex() {
- execution = new Execution(searchChain, Execution.Context.createContextStub(createIndexFacts(false)));
- URIBuilder builder = searchUri();
- builder.setParameter("wql", "foo&bar");
- builder.setParameter("yql", "select * from sources * where ([{\"defaultIndex\": \"text_field\",\"grammar\": \"any\"}]userInput(@wql))");
- Query query = searchAndAssertNoErrors(builder);
- assertEquals("select * from sources * where (text_field contains \"foo\" AND text_field contains \"bar\")", query.yqlRepresentation());
- }
-
- private IndexFacts createIndexFacts(boolean phraseSegmenting) {
- SearchDefinition sd = new SearchDefinition("sources");
- Index test = new Index("text_field");
- test.setPhraseSegmenting(phraseSegmenting);
- sd.addIndex(test);
- return new IndexFacts(new IndexModel(sd));
- }
-
}