aboutsummaryrefslogtreecommitdiffstats
path: root/container-search/src/test/java/com/yahoo/search/test
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@gmail.com>2022-02-01 12:45:45 +0100
committerJon Bratseth <bratseth@gmail.com>2022-02-01 12:45:45 +0100
commit3973e39a4637be97a5579e7a657476e1a0b8d917 (patch)
treebb110e2bee8eca7afc646c44f35152c44f4d6736 /container-search/src/test/java/com/yahoo/search/test
parenta3ac1da80933462fcb332839074efbddaf661023 (diff)
Import types referenced in lambdas
Diffstat (limited to 'container-search/src/test/java/com/yahoo/search/test')
-rw-r--r--container-search/src/test/java/com/yahoo/search/test/QueryTestCase.java14
1 files changed, 14 insertions, 0 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 f6273fdf723..312fe175270 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
@@ -2,6 +2,7 @@
package com.yahoo.search.test;
import com.yahoo.component.chain.Chain;
+import com.yahoo.data.JsonProducer;
import com.yahoo.language.Language;
import com.yahoo.language.Linguistics;
import com.yahoo.language.detect.Detection;
@@ -15,6 +16,7 @@ import com.yahoo.prelude.Index;
import com.yahoo.prelude.IndexFacts;
import com.yahoo.prelude.IndexModel;
import com.yahoo.prelude.SearchDefinition;
+import com.yahoo.prelude.fastsearch.FastHit;
import com.yahoo.prelude.query.AndItem;
import com.yahoo.prelude.query.AndSegmentItem;
import com.yahoo.prelude.query.CompositeItem;
@@ -40,6 +42,7 @@ import com.yahoo.search.query.profile.types.QueryProfileType;
import com.yahoo.search.result.Hit;
import com.yahoo.search.searchchain.Execution;
import com.yahoo.yolean.Exceptions;
+import org.json.JSONObject;
import org.junit.Ignore;
import org.junit.Test;
@@ -69,6 +72,17 @@ import static org.junit.Assert.fail;
public class QueryTestCase {
@Test
+ public void testIt() throws Exception {
+ JSONObject newroot = new JSONObject("{\"key\": 3}");
+ var hit = new FastHit();
+ hit.setField("data", (JsonProducer)s -> s.append(newroot));
+ var field = hit.getField("data");
+ if (field instanceof JsonProducer) {
+ System.out.println((((JsonProducer) field).toJson()));
+ }
+ }
+
+ @Test
public void testSimpleFunctionality() {
Query q = new Query(QueryTestCase.httpEncode("/sdfsd.html?query=this is a simple query&aParameter"));
assertEquals("this is a simple query", q.getModel().getQueryString());