diff options
author | Jon Bratseth <bratseth@gmail.com> | 2021-04-28 15:49:57 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2021-04-28 15:49:57 +0200 |
commit | 2ee3e1d2e9fdda8d10a91e616e3a4f8d758d7dbe (patch) | |
tree | c20f09ad439cb4f2854a27b2a77dbd250c6b3b4d /container-search/src/main/java/com/yahoo/search/query/profile/QueryProfileVariant.java | |
parent | 357de578bc8d79c71ddb6bbbcf37d11d46902020 (diff) |
Use owner's dimensions in BackedOverridableQueryProfile
Use owner's dimensions rather than the backed's in
BackedObverridableQueryProfile. This matters when a profile
references a profile with different but overlapping dimensions
and both the owner and referred profile assigns values for
the same paths, within their respective dimension spaces.
Diffstat (limited to 'container-search/src/main/java/com/yahoo/search/query/profile/QueryProfileVariant.java')
-rw-r--r-- | container-search/src/main/java/com/yahoo/search/query/profile/QueryProfileVariant.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/query/profile/QueryProfileVariant.java b/container-search/src/main/java/com/yahoo/search/query/profile/QueryProfileVariant.java index f6c43eab8a0..855befad658 100644 --- a/container-search/src/main/java/com/yahoo/search/query/profile/QueryProfileVariant.java +++ b/container-search/src/main/java/com/yahoo/search/query/profile/QueryProfileVariant.java @@ -37,7 +37,7 @@ public class QueryProfileVariant implements Cloneable, Comparable<QueryProfileVa * Returns the live reference to the values of this. This may be modified * if this is not frozen. */ - public Map<String,Object> values() { + public Map<String, Object> values() { if (values == null) { if (frozen) return Collections.emptyMap(); @@ -68,6 +68,8 @@ public class QueryProfileVariant implements Cloneable, Comparable<QueryProfileVa Object oldValue = values.get(key); Object combinedOrNull = QueryProfile.combineValues(newValue, oldValue); + if (combinedOrNull instanceof BackedOverridableQueryProfile) // Use the owner's, not the referenced dimensions + ((QueryProfile) combinedOrNull).setDimensions(owner.getDimensions().toArray(new String[0])); if (combinedOrNull != null) values.put(key, combinedOrNull); return combinedOrNull; |