summaryrefslogtreecommitdiffstats
path: root/container-search
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-06-24 21:00:20 +0200
committerHenning Baldersheim <balder@yahoo-inc.com>2022-06-24 21:00:20 +0200
commit4894b51f0fe6566883886c9aeed65a45c56dab96 (patch)
tree0a16dbb0ae985d864a467dae074944bf0f91aa14 /container-search
parent4a53c233ad4f4d6ce2b8afa0873d9596c9c13e99 (diff)
If the context map is empty just return the default
Diffstat (limited to 'container-search')
-rw-r--r--container-search/src/main/java/com/yahoo/search/query/profile/QueryProfileProperties.java2
-rw-r--r--container-search/src/main/java/com/yahoo/search/query/properties/PropertyMap.java3
-rw-r--r--container-search/src/main/java/com/yahoo/search/query/properties/RequestContextProperties.java2
3 files changed, 3 insertions, 4 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/query/profile/QueryProfileProperties.java b/container-search/src/main/java/com/yahoo/search/query/profile/QueryProfileProperties.java
index 3f9df4d9955..7f5df94d020 100644
--- a/container-search/src/main/java/com/yahoo/search/query/profile/QueryProfileProperties.java
+++ b/container-search/src/main/java/com/yahoo/search/query/profile/QueryProfileProperties.java
@@ -298,7 +298,7 @@ public class QueryProfileProperties extends Properties {
private Map<String, String> contextWithZoneInfo(Map<String, String> context) {
if (zoneInfo == ZoneInfo.defaultInfo()) return context;
- if (context == null) return zoneContext;
+ if (context == null || context.isEmpty()) return zoneContext;
if (context == zoneContext) return context;
if (context.containsKey(ENVIRONMENT) && context.containsKey(REGION) && context.containsKey(INSTANCE)) return context;
diff --git a/container-search/src/main/java/com/yahoo/search/query/properties/PropertyMap.java b/container-search/src/main/java/com/yahoo/search/query/properties/PropertyMap.java
index 72388f77173..f60d9820706 100644
--- a/container-search/src/main/java/com/yahoo/search/query/properties/PropertyMap.java
+++ b/container-search/src/main/java/com/yahoo/search/query/properties/PropertyMap.java
@@ -1,6 +1,7 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
package com.yahoo.search.query.properties;
-import com.yahoo.processing.request.*;
+import com.yahoo.processing.request.CompoundName;
import com.yahoo.search.query.Properties;
import java.util.Map;
import java.util.LinkedHashMap;
diff --git a/container-search/src/main/java/com/yahoo/search/query/properties/RequestContextProperties.java b/container-search/src/main/java/com/yahoo/search/query/properties/RequestContextProperties.java
index ad212d05780..0ac61246c48 100644
--- a/container-search/src/main/java/com/yahoo/search/query/properties/RequestContextProperties.java
+++ b/container-search/src/main/java/com/yahoo/search/query/properties/RequestContextProperties.java
@@ -1,12 +1,10 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.query.properties;
-import ai.vespa.cloud.ZoneInfo;
import com.yahoo.processing.request.CompoundName;
import com.yahoo.search.query.Properties;
import java.util.Collections;
-import java.util.HashMap;
import java.util.Map;
/**