diff options
author | Jon Bratseth <bratseth@oath.com> | 2021-05-20 10:53:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-20 10:53:36 +0200 |
commit | ad936521af553e0278d9ceb3c47b328383f34806 (patch) | |
tree | 9da9f555385262760278ef5b886ba0f030c18080 /container-search/src/main/java/com/yahoo | |
parent | 2dfbfeff81d2993ebfdf446a49da68be039763ea (diff) | |
parent | 378017c41fe1aa22252e2b6fe55363afd271c385 (diff) |
Merge pull request #17906 from vespa-engine/bratseth/query-profile-type-inheritance
Bratseth/query profile type inheritance
Diffstat (limited to 'container-search/src/main/java/com/yahoo')
4 files changed, 7 insertions, 7 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/query/SelectParser.java b/container-search/src/main/java/com/yahoo/search/query/SelectParser.java index d212c2d6ec4..f94c6300e83 100644 --- a/container-search/src/main/java/com/yahoo/search/query/SelectParser.java +++ b/container-search/src/main/java/com/yahoo/search/query/SelectParser.java @@ -467,7 +467,6 @@ public class SelectParser implements Parser { } private Item buildNearestNeighbor(String key, Inspector value) { - HashMap<Integer, Inspector> children = childMap(value); Preconditions.checkArgument(children.size() == 2, "Expected 2 arguments, got %s.", children.size()); String field = children.get(0).asString(); 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 41272d695ac..34fe376150d 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 @@ -117,7 +117,7 @@ public class QueryProfileProperties extends Properties { value = fieldDescription.getType().convertFrom(value, profile.getRegistry()); if (value == null) throw new IllegalInputException("'" + value + "' is not a " + - fieldDescription.getType().toInstanceDescription()); + fieldDescription.getType().toInstanceDescription()); } else if (fieldDescription.getType() instanceof QueryProfileFieldType) { // If a type is specified, use that instead of the type implied by the name diff --git a/container-search/src/main/java/com/yahoo/search/query/profile/types/QueryProfileType.java b/container-search/src/main/java/com/yahoo/search/query/profile/types/QueryProfileType.java index c02aada2062..e4396894595 100644 --- a/container-search/src/main/java/com/yahoo/search/query/profile/types/QueryProfileType.java +++ b/container-search/src/main/java/com/yahoo/search/query/profile/types/QueryProfileType.java @@ -177,11 +177,12 @@ public class QueryProfileType extends FreezableSimpleComponent { public void freeze() { if (isFrozen()) return; - // Flatten the inheritance hierarchy into this to facilitate faster lookup + // Flatten for faster lookup for (QueryProfileType inheritedType : inherited) { for (FieldDescription field : inheritedType.fields().values()) - if ( ! fields.containsKey(field.getName())) - fields.put(field.getName(),field); + if ( ! fields.containsKey(field.getName())) { + fields.put(field.getName(), field); + } } fields = ImmutableMap.copyOf(fields); inherited = ImmutableList.copyOf(inherited); @@ -354,9 +355,10 @@ public class QueryProfileType extends FreezableSimpleComponent { if (inherited().size() == 0) return Collections.unmodifiableMap(fields); // Collapse inherited - Map<String, FieldDescription> allFields = new HashMap<>(fields); + Map<String, FieldDescription> allFields = new HashMap<>(); for (QueryProfileType inheritedType : inherited) allFields.putAll(inheritedType.fields()); + allFields.putAll(fields); return Collections.unmodifiableMap(allFields); } diff --git a/container-search/src/main/java/com/yahoo/search/searchers/ValidateNearestNeighborSearcher.java b/container-search/src/main/java/com/yahoo/search/searchers/ValidateNearestNeighborSearcher.java index 65ca4a93cc1..ca9d17cb656 100644 --- a/container-search/src/main/java/com/yahoo/search/searchers/ValidateNearestNeighborSearcher.java +++ b/container-search/src/main/java/com/yahoo/search/searchers/ValidateNearestNeighborSearcher.java @@ -29,7 +29,6 @@ import java.util.Optional; * * @author arnej */ -@Beta @Before(GroupingExecutor.COMPONENT_NAME) // Must happen before query.prepare() public class ValidateNearestNeighborSearcher extends Searcher { |