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 /config-model/src/main/java/com/yahoo/vespa/model/container/search/QueryProfiles.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 'config-model/src/main/java/com/yahoo/vespa/model/container/search/QueryProfiles.java')
-rw-r--r-- | config-model/src/main/java/com/yahoo/vespa/model/container/search/QueryProfiles.java | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/search/QueryProfiles.java b/config-model/src/main/java/com/yahoo/vespa/model/container/search/QueryProfiles.java index 3227646041a..e5ed20e19ec 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/container/search/QueryProfiles.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/container/search/QueryProfiles.java @@ -65,12 +65,13 @@ public class QueryProfiles implements Serializable, QueryProfilesConfig.Producer if ( registry.getTypeRegistry().hasApplicationTypes() && registry.allComponents().isEmpty()) { logger.logApplicationPackage(Level.WARNING, "This application define query profile types, but has " + - "no query profiles referencing them so they have no effect. " + - (tensorFields.isEmpty() - ? "" - : "In particular, the tensors (" + String.join(", ", tensorFields) + - ") will be interpreted as strings, not tensors if sent in requests. ") + - "See https://docs.vespa.ai/en/query-profiles.html"); + "no query profiles referencing them so they have no effect. " + + (tensorFields.isEmpty() ? "" + : "In particular, the tensors (" + + String.join(", ", tensorFields) + + ") will be interpreted as strings, " + + "not tensors if sent in requests. ") + + "See https://docs.vespa.ai/en/query-profiles.html"); } } @@ -100,7 +101,7 @@ public class QueryProfiles implements Serializable, QueryProfilesConfig.Producer for (QueryProfile inherited : profile.inherited()) qB.inherit(inherited.getId().stringValue()); - if (profile.getVariants()!=null) { + if (profile.getVariants() != null) { for (String dimension : profile.getVariants().getDimensions()) qB.dimensions(dimension); } @@ -180,7 +181,7 @@ public class QueryProfiles implements Serializable, QueryProfilesConfig.Producer QueryProfilesConfig.Queryprofile.Queryprofilevariant.Reference.Builder refB = new QueryProfilesConfig.Queryprofile.Queryprofilevariant.Reference.Builder(); createVariantReferenceFieldConfig(refB, fullName, ((BackedOverridableQueryProfile) subProfile).getBacking().getId().stringValue()); qpB.reference(refB); - addVariantFieldChildren(qpB, subProfile,fullName + "."); + addVariantFieldChildren(qpB, subProfile, fullName + "."); } } else { // a primitive @@ -208,7 +209,7 @@ public class QueryProfiles implements Serializable, QueryProfilesConfig.Producer } qB.queryprofilevariant(varB); } - } + } private void createReferenceFieldConfig(QueryProfilesConfig.Queryprofile.Reference.Builder refB, QueryProfile profile, String fullName, String localName, String stringValue) { |