summaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo/search/Query.java
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2019-08-13 14:52:38 +0200
committerHenning Baldersheim <balder@yahoo-inc.com>2019-08-13 14:52:38 +0200
commit20ced3096e1b38287fec3a6f015a5a2980cf3a0e (patch)
treebe5499f8da9acd38e97f6a3611add8856475718c /container-search/src/main/java/com/yahoo/search/Query.java
parent6e73a5ae5ba01ca99fe80137725e3e9df5644ec9 (diff)
Avoid exposing internals in public api.
Diffstat (limited to 'container-search/src/main/java/com/yahoo/search/Query.java')
-rw-r--r--container-search/src/main/java/com/yahoo/search/Query.java22
1 files changed, 6 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 fa5f4b0fb39..e0bd3fc4f99 100644
--- a/container-search/src/main/java/com/yahoo/search/Query.java
+++ b/container-search/src/main/java/com/yahoo/search/Query.java
@@ -13,6 +13,7 @@ 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.dispatch.rpc.ProtobufSerialization;
import com.yahoo.search.federation.FederationSearcher;
import com.yahoo.search.query.Model;
import com.yahoo.search.query.ParameterParser;
@@ -102,7 +103,7 @@ public class Query extends com.yahoo.processing.Request implements Cloneable {
WEB(4,"web"),
PROGRAMMATIC(5, "prog"),
YQL(6, "yql"),
- SELECT(7, "select");;
+ SELECT(7, "select");
private final int intValue;
private final String stringValue;
@@ -495,7 +496,7 @@ public class Query extends com.yahoo.processing.Request implements Cloneable {
private void appendQueryProfileProperties(CompiledQueryProfile profile,Set<String> mentioned,StringBuilder b) {
for (Map.Entry<String,Object> property : profile.listValues("", requestProperties()).entrySet()) {
if ( ! mentioned.contains(property.getKey()))
- b.append(property.getKey() + "=" + property.getValue() + " (value from query profile)<br/>\n");
+ b.append(property.getKey()).append("=").append(property.getValue()).append(" (value from query profile)<br/>\n");
}
}
@@ -741,7 +742,7 @@ public class Query extends com.yahoo.processing.Request implements Cloneable {
StringBuilder concatenated = new StringBuilder();
for (Object message : messages)
- concatenated.append(String.valueOf(message));
+ concatenated.append(message);
trace(concatenated.toString(), includeQuery, traceLevel);
}
@@ -1090,25 +1091,14 @@ public class Query extends com.yahoo.processing.Request implements Cloneable {
return Collections.singletonMap("grouping", true);
if (ranking.getQueryCache())
return Collections.singletonMap("query", true);
- return Collections.<String,Boolean>emptyMap();
- }
-
- public int getTraceLevelForBackend() {
- int traceLevel = getTraceLevel();
- if (model.getExecution().trace().getForceTimestamps()) {
- traceLevel = Math.max(traceLevel, 5); // Backend produces timing information on level 4 and 5
- }
- if (getExplainLevel() > 0) {
- traceLevel = Math.max(traceLevel, getExplainLevel() + 5);
- }
- return traceLevel;
+ return Collections.emptyMap();
}
private Map<String, String> createModelMap() {
Map<String, String> m = new HashMap<>();
if (model.getSearchPath() != null) m.put("searchpath", model.getSearchPath());
- int traceLevel = getTraceLevelForBackend();
+ int traceLevel = ProtobufSerialization.getTraceLevelForBackend(this);
if (traceLevel > 0) m.put("tracelevel", String.valueOf(traceLevel));
return m;