diff options
11 files changed, 46 insertions, 22 deletions
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/processing/MatchedElementsOnlyResolver.java b/config-model/src/main/java/com/yahoo/searchdefinition/processing/MatchedElementsOnlyResolver.java index d86ed265b77..77064038053 100644 --- a/config-model/src/main/java/com/yahoo/searchdefinition/processing/MatchedElementsOnlyResolver.java +++ b/config-model/src/main/java/com/yahoo/searchdefinition/processing/MatchedElementsOnlyResolver.java @@ -48,11 +48,13 @@ public class MatchedElementsOnlyResolver extends Processor { if (isComplexFieldWithOnlyStructFieldAttributes(sourceField)) { field.setTransform(SummaryTransform.MATCHED_ATTRIBUTE_ELEMENTS_FILTER); } - } else if (isSupportedAttributeField(sourceField)) { - field.setTransform(SummaryTransform.MATCHED_ATTRIBUTE_ELEMENTS_FILTER); + } else if (isSupportedMultiValueField(sourceField)) { + if (sourceField.doesAttributing()) { + field.setTransform(SummaryTransform.MATCHED_ATTRIBUTE_ELEMENTS_FILTER); + } } else if (validate) { fail(summary, field, "'matched-elements-only' is not supported for this field type. " + - "Supported field types are: array attribute, weighted set attribute, " + + "Supported field types are: array of primitive, weighted set of primitive, " + "array of simple struct, map of primitive type to simple struct, " + "and map of primitive type to primitive type"); } @@ -60,10 +62,9 @@ public class MatchedElementsOnlyResolver extends Processor { // else case is handled in SummaryFieldsMustHaveValidSource } - private boolean isSupportedAttributeField(ImmutableSDField sourceField) { + private boolean isSupportedMultiValueField(ImmutableSDField sourceField) { var type = sourceField.getDataType(); - return sourceField.doesAttributing() && - (isArrayOfPrimitiveType(type) || isWeightedsetOfPrimitiveType(type)); + return (isArrayOfPrimitiveType(type) || isWeightedsetOfPrimitiveType(type)); } private boolean isArrayOfPrimitiveType(DataType type) { diff --git a/config-model/src/main/java/com/yahoo/vespa/model/admin/LogserverContainerCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/admin/LogserverContainerCluster.java index 24e88d7ef7d..34c0aed826e 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/admin/LogserverContainerCluster.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/admin/LogserverContainerCluster.java @@ -31,7 +31,7 @@ public class LogserverContainerCluster extends ContainerCluster<LogserverContain @Override public void getConfig(QrStartConfig.Builder builder) { super.getConfig(builder); - builder.jvm.heapsize(384); + builder.jvm.heapsize(512); } protected boolean messageBusEnabled() { return false; } diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/MatchedElementsOnlyResolverTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/MatchedElementsOnlyResolverTestCase.java index 0ef696df6cf..ab98706fd44 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/MatchedElementsOnlyResolverTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/MatchedElementsOnlyResolverTestCase.java @@ -149,10 +149,10 @@ public class MatchedElementsOnlyResolverTestCase { exceptionRule.expect(IllegalArgumentException.class); exceptionRule.expectMessage("For search 'test', document summary 'default', summary field 'my_field': " + "'matched-elements-only' is not supported for this field type. " + - "Supported field types are: array attribute, weighted set attribute, " + + "Supported field types are: array of primitive, weighted set of primitive, " + "array of simple struct, map of primitive type to simple struct, " + "and map of primitive type to primitive type"); - buildSearch(joinLines("field my_field type array<string> {", + buildSearch(joinLines("field my_field type string {", " indexing: summary", " summary: matched-elements-only", "}")); diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java index 0ef25d0f613..6bc0ec6baf8 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java @@ -869,7 +869,12 @@ public class InternalStepRunner implements StepRunner { ? " <component id=\"" + runtimeProviderClass + "\" bundle=\"" + tenantCdBundle + "\" />\n" + "\n" + - " <component id=\"com.yahoo.vespa.testrunner.JunitRunner\" bundle=\"vespa-osgi-testrunner\" />\n" + + " <component id=\"com.yahoo.vespa.testrunner.JunitRunner\" bundle=\"vespa-osgi-testrunner\">\n" + + " <config name=\"com.yahoo.vespa.testrunner.junit-test-runner\">\n" + + " <artifactsPath>artifacts</artifactsPath>\n" + + " <useAthenzCredentials>" + systemUsesAthenz + "</useAthenzCredentials>\n" + + " </config>\n" + + " </component>\n" + "\n" + " <handler id=\"com.yahoo.vespa.testrunner.TestRunnerHandler\" bundle=\"vespa-osgi-testrunner\">\n" + " <binding>http://*/tester/v1/*</binding>\n" + diff --git a/controller-server/src/test/resources/test_runner_services.xml-cd-osgi b/controller-server/src/test/resources/test_runner_services.xml-cd-osgi index 03277628156..d1a83abff8d 100644 --- a/controller-server/src/test/resources/test_runner_services.xml-cd-osgi +++ b/controller-server/src/test/resources/test_runner_services.xml-cd-osgi @@ -13,7 +13,12 @@ <component id="ai.vespa.hosted.cd.cloud.impl.VespaTestRuntimeProvider" bundle="cloud-tenant-cd" /> - <component id="com.yahoo.vespa.testrunner.JunitRunner" bundle="vespa-osgi-testrunner" /> + <component id="com.yahoo.vespa.testrunner.JunitRunner" bundle="vespa-osgi-testrunner"> + <config name="com.yahoo.vespa.testrunner.junit-test-runner"> + <artifactsPath>artifacts</artifactsPath> + <useAthenzCredentials>true</useAthenzCredentials> + </config> + </component> <handler id="com.yahoo.vespa.testrunner.TestRunnerHandler" bundle="vespa-osgi-testrunner"> <binding>http://*/tester/v1/*</binding> diff --git a/searchsummary/src/vespa/searchsummary/docsummary/matched_elements_filter_dfw.h b/searchsummary/src/vespa/searchsummary/docsummary/matched_elements_filter_dfw.h index 087ddfd8d40..353f0df8bee 100644 --- a/searchsummary/src/vespa/searchsummary/docsummary/matched_elements_filter_dfw.h +++ b/searchsummary/src/vespa/searchsummary/docsummary/matched_elements_filter_dfw.h @@ -9,8 +9,9 @@ namespace search::attribute { class IAttributeContext; } namespace search::docsummary { /** - * Field writer that filters matched elements (according to the query) from a complex field - * (map of primitives, map of struct, array of struct) that is retrieved from the document store. + * Field writer that filters matched elements (according to the query) from a multi-value or complex field + * (array of primitive, weighted set of primitive, map of primitives, map of struct, array of struct) + * that is retrieved from the document store. */ class MatchedElementsFilterDFW : public IDocsumFieldWriter { private: diff --git a/streamingvisitors/src/vespa/searchvisitor/matching_elements_filler.cpp b/streamingvisitors/src/vespa/searchvisitor/matching_elements_filler.cpp index fe717313ca4..d51bd57e942 100644 --- a/streamingvisitors/src/vespa/searchvisitor/matching_elements_filler.cpp +++ b/streamingvisitors/src/vespa/searchvisitor/matching_elements_filler.cpp @@ -83,6 +83,9 @@ Matcher::select_query_nodes(const MatchingElementsFields& fields, const QueryNod if (fields.has_struct_field(query_term->getIndex())) { _sub_field_terms.emplace_back(fields.get_enclosing_field(query_term->getIndex()), query_term); } + if (fields.has_field(query_term->getIndex())) { + _sub_field_terms.emplace_back(query_term->getIndex(), query_term); + } } else if (auto and_not = as<AndNotQueryNode>(query_node)) { select_query_nodes(fields, *(*and_not)[0]); } else if (auto intermediate = as<QueryConnector>(query_node)) { diff --git a/vespa-osgi-testrunner/CMakeLists.txt b/vespa-osgi-testrunner/CMakeLists.txt index 58aba186710..4b097a2f7bf 100644 --- a/vespa-osgi-testrunner/CMakeLists.txt +++ b/vespa-osgi-testrunner/CMakeLists.txt @@ -1,2 +1,3 @@ # Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. install_fat_java_artifact(vespa-osgi-testrunner) +install_config_definition(src/main/resources/configdefinitions/junit-test-runner.def com.yahoo.vespa.testrunner.junit-test-runner.def) diff --git a/vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/JunitRunner.java b/vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/JunitRunner.java index 5fb7344dc74..7c86347a5b9 100644 --- a/vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/JunitRunner.java +++ b/vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/JunitRunner.java @@ -4,10 +4,10 @@ package com.yahoo.vespa.testrunner; import ai.vespa.hosted.api.TestDescriptor; import ai.vespa.hosted.cd.internal.TestRuntimeProvider; import com.google.inject.Inject; -import com.yahoo.cloud.config.ConfigserverConfig; import com.yahoo.component.AbstractComponent; import com.yahoo.io.IOUtils; import com.yahoo.jdisc.application.OsgiFramework; +import com.yahoo.vespa.defaults.Defaults; import com.yahoo.vespa.testrunner.legacy.LegacyTestRunner; import org.junit.jupiter.engine.JupiterTestEngine; import org.junit.platform.engine.discovery.DiscoverySelectors; @@ -47,11 +47,11 @@ public class JunitRunner extends AbstractComponent { @Inject public JunitRunner(OsgiFramework osgiFramework, - TestRuntimeProvider testRuntimeProvider, - ConfigserverConfig configserverConfig) { + JunitTestRunnerConfig config, + TestRuntimeProvider testRuntimeProvider) { this.testRuntimeProvider = testRuntimeProvider; this.bundleContext = getUnrestrictedBundleContext(osgiFramework); - uglyHackSetCredentialsRootSystemProperty(configserverConfig); + uglyHackSetCredentialsRootSystemProperty(config); } // Hack to retrieve bundle context that allows access to other bundles @@ -66,13 +66,13 @@ public class JunitRunner extends AbstractComponent { } } - // TODO(bjorncs|tokle) Propagate credentials root without ConfigserverConfig and system property - private static void uglyHackSetCredentialsRootSystemProperty(ConfigserverConfig config) { + // TODO(bjorncs|tokle) Propagate credentials root without system property. Ideally move knowledge about path to test-runtime implementations + private static void uglyHackSetCredentialsRootSystemProperty(JunitTestRunnerConfig config) { String credentialsRoot; - if (config.system().equals("public") || config.system().equals("publiccd")) { - credentialsRoot = "/opt/vespa/tmp/test/artifacts"; + if (config.useAthenzCredentials()) { + credentialsRoot = Defaults.getDefaults().underVespaHome("var/vespa/sia"); } else { - credentialsRoot = "/opt/vespa/var/vespa/sia"; + credentialsRoot = config.artifactsPath().toString(); } System.setProperty("vespa.test.credentials.root", credentialsRoot); } diff --git a/vespa-osgi-testrunner/src/main/resources/configdefinitions/junit-test-runner.def b/vespa-osgi-testrunner/src/main/resources/configdefinitions/junit-test-runner.def new file mode 100644 index 00000000000..20a01014803 --- /dev/null +++ b/vespa-osgi-testrunner/src/main/resources/configdefinitions/junit-test-runner.def @@ -0,0 +1,5 @@ +# Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package=com.yahoo.vespa.testrunner + +artifactsPath path +useAthenzCredentials bool default=false
\ No newline at end of file diff --git a/vsm/src/vespa/vsm/vsm/docsumconfig.cpp b/vsm/src/vespa/vsm/vsm/docsumconfig.cpp index 2512bea26df..fb25df83ded 100644 --- a/vsm/src/vespa/vsm/vsm/docsumconfig.cpp +++ b/vsm/src/vespa/vsm/vsm/docsumconfig.cpp @@ -26,6 +26,9 @@ void populate_fields(MatchingElementsFields& fields, VsmfieldsConfig& fields_con if (spec.name.substr(0, prefix.size()) == prefix) { fields.add_mapping(field_name, spec.name); } + if (spec.name == field_name) { + fields.add_field(field_name); + } } } |