diff options
author | Jon Bratseth <bratseth@yahoo-inc.com> | 2018-01-15 11:36:47 +0100 |
---|---|---|
committer | Jon Bratseth <bratseth@yahoo-inc.com> | 2018-01-15 11:36:47 +0100 |
commit | f3aaa08db00c9df1758fb1ab863ebba13ca043d3 (patch) | |
tree | 7c66b71ef6d77c54d2a756b720d02ce1a2f16e63 /container-search | |
parent | 6bca358e80a11455ee7ef387dfe5f50719460000 (diff) |
Nonfunctional changes only
Diffstat (limited to 'container-search')
-rw-r--r-- | container-search/src/main/java/com/yahoo/search/Query.java | 36 | ||||
-rw-r--r-- | container-search/src/test/java/com/yahoo/search/test/QueryTestCase.java | 16 |
2 files changed, 36 insertions, 16 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/Query.java b/container-search/src/main/java/com/yahoo/search/Query.java index adf01f161a4..b2349ed6dfc 100644 --- a/container-search/src/main/java/com/yahoo/search/Query.java +++ b/container-search/src/main/java/com/yahoo/search/Query.java @@ -12,31 +12,38 @@ import com.yahoo.prelude.query.Highlight; import com.yahoo.prelude.query.QueryException; import com.yahoo.prelude.query.textualrepresentation.TextualQueryRepresentation; import com.yahoo.processing.request.CompoundName; -import com.yahoo.search.query.*; -import com.yahoo.search.query.profile.types.FieldType; -import com.yahoo.search.query.properties.PropertyMap; +import com.yahoo.search.federation.FederationSearcher; +import com.yahoo.search.query.Model; +import com.yahoo.search.query.ParameterParser; +import com.yahoo.search.query.Presentation; +import com.yahoo.search.query.Properties; +import com.yahoo.search.query.QueryTree; +import com.yahoo.search.query.Ranking; +import com.yahoo.search.query.SessionId; +import com.yahoo.search.query.Sorting; +import com.yahoo.search.query.Sorting.AttributeSorter; +import com.yahoo.search.query.Sorting.FieldOrder; +import com.yahoo.search.query.Sorting.Order; +import com.yahoo.search.query.UniqueRequestId; +import com.yahoo.search.query.context.QueryContext; +import com.yahoo.search.query.profile.ModelObjectMap; +import com.yahoo.search.query.profile.QueryProfileProperties; +import com.yahoo.search.query.profile.compiled.CompiledQueryProfile; import com.yahoo.search.query.profile.compiled.CompiledQueryProfileRegistry; import com.yahoo.search.query.profile.types.FieldDescription; +import com.yahoo.search.query.profile.types.FieldType; import com.yahoo.search.query.profile.types.QueryProfileFieldType; import com.yahoo.search.query.profile.types.QueryProfileType; import com.yahoo.search.query.profile.types.QueryProfileTypeRegistry; import com.yahoo.search.query.properties.DefaultProperties; +import com.yahoo.search.query.properties.PropertyMap; import com.yahoo.search.query.properties.QueryProperties; import com.yahoo.search.query.properties.QueryPropertyAliases; import com.yahoo.search.query.properties.RequestContextProperties; -import com.yahoo.yolean.Exceptions; -import com.yahoo.search.federation.FederationSearcher; -import com.yahoo.search.query.Sorting.AttributeSorter; -import com.yahoo.search.query.Sorting.FieldOrder; -import com.yahoo.search.query.Sorting.Order; -import com.yahoo.search.query.context.QueryContext; -import com.yahoo.search.query.profile.ModelObjectMap; -import com.yahoo.search.query.profile.QueryProfileProperties; -import com.yahoo.search.query.profile.compiled.CompiledQueryProfile; import com.yahoo.search.yql.NullItemException; import com.yahoo.search.yql.VespaSerializer; import com.yahoo.search.yql.YqlParser; - +import com.yahoo.yolean.Exceptions; import edu.umd.cs.findbugs.annotations.Nullable; import java.nio.ByteBuffer; @@ -45,7 +52,6 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; -import java.util.concurrent.atomic.AtomicReference; import java.util.logging.Logger; /** @@ -951,8 +957,6 @@ public class Query extends com.yahoo.processing.Request implements Cloneable { /** * Return the HTTP request which caused this query. This will never be null * when running with queries from the network. - * (Except when running with deprecated code paths, in which case this will - * return null but getRequest() will not.) */ public HttpRequest getHttpRequest() { return httpRequest; } 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 62eacaa0afe..2a36e30b95a 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,9 +2,13 @@ package com.yahoo.search.test; import com.yahoo.component.chain.Chain; +import com.yahoo.language.Language; +import com.yahoo.language.Linguistics; import com.yahoo.language.detect.Detection; import com.yahoo.language.detect.Detector; import com.yahoo.language.detect.Hint; +import com.yahoo.language.process.StemMode; +import com.yahoo.language.process.Token; import com.yahoo.language.simple.SimpleDetector; import com.yahoo.language.simple.SimpleLinguistics; import com.yahoo.prelude.Index; @@ -65,6 +69,18 @@ public class QueryTestCase { assertNull(q.getModel().getDefaultIndex()); assertEquals("", q.properties().get("aParameter")); assertNull(q.properties().get("notSetParameter")); + + Query query = q; + String body = "a bb. ccc??!"; + Linguistics linguistics = new SimpleLinguistics(); + + AndItem and = new AndItem(); + for (Token token : linguistics.getTokenizer().tokenize(body, Language.ENGLISH, StemMode.SHORTEST, true)) { + if (token.isIndexable()) + and.addItem(new WordItem(token.getTokenString(), "body")); + } + query.getModel().getQueryTree().setRoot(and); + System.out.println(query); } // TODO: YQL work in progress (jon) |