aboutsummaryrefslogtreecommitdiffstats
path: root/container-search
diff options
context:
space:
mode:
Diffstat (limited to 'container-search')
-rw-r--r--container-search/abi-spec.json2
-rw-r--r--container-search/src/main/java/com/yahoo/prelude/cluster/ClusterSearcher.java30
-rw-r--r--container-search/src/main/java/com/yahoo/prelude/searcher/ValidateSortingSearcher.java21
-rw-r--r--container-search/src/main/java/com/yahoo/search/grouping/GroupingValidator.java12
-rw-r--r--container-search/src/main/java/com/yahoo/search/searchers/ValidateMatchPhaseSearcher.java1
-rw-r--r--container-search/src/main/resources/configdefinitions/search.config.cluster.def15
-rw-r--r--container-search/src/test/java/com/yahoo/prelude/cluster/ClusterSearcherTestCase.java1
-rw-r--r--container-search/src/test/java/com/yahoo/prelude/searcher/test/ValidateSortingSearcherTestCase.java12
-rw-r--r--container-search/src/test/java/com/yahoo/search/grouping/GroupingValidatorTestCase.java19
9 files changed, 37 insertions, 76 deletions
diff --git a/container-search/abi-spec.json b/container-search/abi-spec.json
index 73376ac4b25..18d1345cb06 100644
--- a/container-search/abi-spec.json
+++ b/container-search/abi-spec.json
@@ -2492,7 +2492,7 @@
"public"
],
"methods" : [
- "public void <init>(com.yahoo.container.QrSearchersConfig, com.yahoo.search.config.ClusterConfig, com.yahoo.vespa.config.search.AttributesConfig)",
+ "public void <init>(com.yahoo.search.config.ClusterConfig, com.yahoo.vespa.config.search.AttributesConfig)",
"public com.yahoo.search.Result search(com.yahoo.search.Query, com.yahoo.search.searchchain.Execution)"
],
"fields" : [
diff --git a/container-search/src/main/java/com/yahoo/prelude/cluster/ClusterSearcher.java b/container-search/src/main/java/com/yahoo/prelude/cluster/ClusterSearcher.java
index 855a524473d..cb5ac7a6a4f 100644
--- a/container-search/src/main/java/com/yahoo/prelude/cluster/ClusterSearcher.java
+++ b/container-search/src/main/java/com/yahoo/prelude/cluster/ClusterSearcher.java
@@ -6,7 +6,6 @@ import com.yahoo.component.annotation.Inject;
import com.yahoo.component.ComponentId;
import com.yahoo.component.chain.dependencies.After;
import com.yahoo.component.provider.ComponentRegistry;
-import com.yahoo.container.QrSearchersConfig;
import com.yahoo.container.core.documentapi.VespaDocumentAccess;
import com.yahoo.container.handler.VipStatus;
import com.yahoo.prelude.fastsearch.ClusterParams;
@@ -71,7 +70,6 @@ public class ClusterSearcher extends Searcher {
@Inject
public ClusterSearcher(ComponentId id,
Executor executor,
- QrSearchersConfig qrsConfig,
ClusterConfig clusterConfig,
DocumentdbInfoConfig documentDbConfig,
SchemaInfo schemaInfo,
@@ -84,7 +82,6 @@ public class ClusterSearcher extends Searcher {
this.schemaInfo = schemaInfo;
int searchClusterIndex = clusterConfig.clusterId();
searchClusterName = clusterConfig.clusterName();
- QrSearchersConfig.Searchcluster searchClusterConfig = getSearchClusterConfigFromClusterName(qrsConfig, searchClusterName);
this.globalPhaseRanker = globalPhaseRanker;
schema2Searcher = new LinkedHashMap<>();
@@ -92,9 +89,7 @@ public class ClusterSearcher extends Searcher {
maxQueryCacheTimeout = ParameterParser.asMilliSeconds(clusterConfig.maxQueryCacheTimeout(), DEFAULT_MAX_QUERY_CACHE_TIMEOUT);
VespaBackend streaming = null, indexed = null;
- ClusterParams clusterParams = makeClusterParams(searchClusterIndex, qrsConfig
- .com().yahoo().prelude().fastsearch().IndexedBackend().docsum()
- .defaultclass(), documentDbConfig, schemaInfo);
+ ClusterParams clusterParams = makeClusterParams(searchClusterIndex, documentDbConfig, schemaInfo);
for (DocumentdbInfoConfig.Documentdb docDb : documentDbConfig.documentdb()) {
if (docDb.mode() == DocumentdbInfoConfig.Documentdb.Mode.Enum.INDEX) {
if (indexed == null) {
@@ -103,7 +98,7 @@ public class ClusterSearcher extends Searcher {
schema2Searcher.put(docDb.name(), indexed);
} else if (docDb.mode() == DocumentdbInfoConfig.Documentdb.Mode.Enum.STREAMING) {
if (streaming == null) {
- streaming = streamingCluster(clusterParams, searchClusterConfig, access);
+ streaming = streamingCluster(clusterParams, clusterConfig, access);
vipStatus.addToRotation(streaming.getName());
}
schema2Searcher.put(docDb.name(), streaming);
@@ -111,21 +106,10 @@ public class ClusterSearcher extends Searcher {
}
}
- private static QrSearchersConfig.Searchcluster getSearchClusterConfigFromClusterName(QrSearchersConfig config, String name) {
- for (QrSearchersConfig.Searchcluster searchCluster : config.searchcluster()) {
- if (searchCluster.name().equals(name)) {
- return searchCluster;
- }
- }
- throw new IllegalStateException("No configured search cluster '" + name + "' among : " +
- config.searchcluster().stream().map(QrSearchersConfig.Searchcluster::name).toList());
- }
-
- private static ClusterParams makeClusterParams(int searchclusterIndex, String defaultSummary,
- DocumentdbInfoConfig documentDbConfig, SchemaInfo schemaInfo)
+ private static ClusterParams makeClusterParams(int searchclusterIndex, DocumentdbInfoConfig documentDbConfig, SchemaInfo schemaInfo)
{
return new ClusterParams("sc" + searchclusterIndex + ".num" + 0, UUID.randomUUID().toString(),
- defaultSummary, documentDbConfig, schemaInfo);
+ null, documentDbConfig, schemaInfo);
}
private static IndexedBackend searchDispatch(ClusterParams clusterParams,
@@ -140,11 +124,11 @@ public class ClusterSearcher extends Searcher {
}
private static StreamingBackend streamingCluster(ClusterParams clusterParams,
- QrSearchersConfig.Searchcluster searchClusterConfig,
+ ClusterConfig clusterConfig,
VespaDocumentAccess access)
{
- return new StreamingBackend(clusterParams, searchClusterConfig.rankprofiles_configid(),
- access, searchClusterConfig.storagecluster().routespec());
+ return new StreamingBackend(clusterParams, clusterConfig.configid(),
+ access, clusterConfig.storageRoute());
}
/** Do not use, for internal testing purposes only. **/
diff --git a/container-search/src/main/java/com/yahoo/prelude/searcher/ValidateSortingSearcher.java b/container-search/src/main/java/com/yahoo/prelude/searcher/ValidateSortingSearcher.java
index a25cc30955e..96bf40195e9 100644
--- a/container-search/src/main/java/com/yahoo/prelude/searcher/ValidateSortingSearcher.java
+++ b/container-search/src/main/java/com/yahoo/prelude/searcher/ValidateSortingSearcher.java
@@ -3,7 +3,6 @@ package com.yahoo.prelude.searcher;
import com.yahoo.component.chain.dependencies.After;
import com.yahoo.component.chain.dependencies.Before;
-import com.yahoo.container.QrSearchersConfig;
import com.yahoo.search.Query;
import com.yahoo.search.Result;
import com.yahoo.search.Searcher;
@@ -32,14 +31,12 @@ public class ValidateSortingSearcher extends Searcher {
private Map<String, AttributesConfig.Attribute> attributeNames = null;
private String clusterName = "";
- private final QrSearchersConfig.Searchcluster.Indexingmode.Enum indexingMode;
+ private final boolean enabled;
- public ValidateSortingSearcher(QrSearchersConfig qrsConfig, ClusterConfig clusterConfig,
- AttributesConfig attributesConfig) {
+ public ValidateSortingSearcher(ClusterConfig clusterConfig, AttributesConfig attributesConfig) {
initAttributeNames(attributesConfig);
- var searchCluster = qrsConfig.searchcluster(clusterConfig.clusterId());
- setClusterName(searchCluster.name());
- indexingMode = searchCluster.indexingmode();
+ setClusterName(clusterConfig.clusterName());
+ enabled = clusterConfig.indexMode() != ClusterConfig.IndexMode.Enum.STREAMING;
}
public String getClusterName() {
@@ -70,12 +67,10 @@ public class ValidateSortingSearcher extends Searcher {
@Override
public Result search(Query query, Execution execution) {
ErrorMessage e = validate(query);
- if (indexingMode != QrSearchersConfig.Searchcluster.Indexingmode.STREAMING) {
- if (e != null) {
- Result r = new Result(query);
- r.hits().addError(e);
- return r;
- }
+ if (enabled && e != null) {
+ Result r = new Result(query);
+ r.hits().addError(e);
+ return r;
}
return execution.search(query);
}
diff --git a/container-search/src/main/java/com/yahoo/search/grouping/GroupingValidator.java b/container-search/src/main/java/com/yahoo/search/grouping/GroupingValidator.java
index d4e295fb51f..165469d59ee 100644
--- a/container-search/src/main/java/com/yahoo/search/grouping/GroupingValidator.java
+++ b/container-search/src/main/java/com/yahoo/search/grouping/GroupingValidator.java
@@ -8,7 +8,6 @@ import com.yahoo.component.chain.dependencies.Provides;
import com.yahoo.processing.IllegalInputException;
import com.yahoo.search.grouping.request.AttributeMapLookupValue;
import com.yahoo.vespa.config.search.AttributesConfig;
-import com.yahoo.container.QrSearchersConfig;
import com.yahoo.processing.request.CompoundName;
import com.yahoo.search.Query;
import com.yahoo.search.Result;
@@ -45,17 +44,12 @@ public class GroupingValidator extends Searcher {
/**
* Constructs a new instance of this searcher with the given component id and config.
*
- * @param qrsConfig The shared config for all searchers.
* @param clusterConfig The config for the cluster that this searcher is deployed for.
*/
@Inject
- public GroupingValidator(QrSearchersConfig qrsConfig, ClusterConfig clusterConfig,
- AttributesConfig attributesConfig) {
- int clusterId = clusterConfig.clusterId();
- var searchCluster = qrsConfig.searchcluster(clusterId);
- QrSearchersConfig.Searchcluster.Indexingmode.Enum indexingMode = searchCluster.indexingmode();
- enabled = (indexingMode != QrSearchersConfig.Searchcluster.Indexingmode.STREAMING);
- clusterName = searchCluster.name();
+ public GroupingValidator(ClusterConfig clusterConfig, AttributesConfig attributesConfig) {
+ enabled = (clusterConfig.indexMode() != ClusterConfig.IndexMode.Enum.STREAMING);
+ clusterName = clusterConfig.clusterName();
for (AttributesConfig.Attribute attr : attributesConfig.attribute()) {
attributes.put(attr.name(), attr);
}
diff --git a/container-search/src/main/java/com/yahoo/search/searchers/ValidateMatchPhaseSearcher.java b/container-search/src/main/java/com/yahoo/search/searchers/ValidateMatchPhaseSearcher.java
index 7761660d551..c5ffb6c02ea 100644
--- a/container-search/src/main/java/com/yahoo/search/searchers/ValidateMatchPhaseSearcher.java
+++ b/container-search/src/main/java/com/yahoo/search/searchers/ValidateMatchPhaseSearcher.java
@@ -1,7 +1,6 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.searchers;
-import com.yahoo.container.QrSearchersConfig;
import com.yahoo.search.Query;
import com.yahoo.search.Result;
import com.yahoo.search.Searcher;
diff --git a/container-search/src/main/resources/configdefinitions/search.config.cluster.def b/container-search/src/main/resources/configdefinitions/search.config.cluster.def
index 2bd98f86ca8..ac88d5baa24 100644
--- a/container-search/src/main/resources/configdefinitions/search.config.cluster.def
+++ b/container-search/src/main/resources/configdefinitions/search.config.cluster.def
@@ -5,17 +5,11 @@ namespace=search.config
#Note: Use clusterName where possible instead
clusterId int default=0
-# Not used
-cacheSize int default=1
-
#Timeout for internal searcher cache. Entries older than this number
#of seconds will be removed from cache. 0 or less means the cache is
#disabled.
cacheTimeout double default=0
-#Whether or not to try another TLD if the current request fails.
-failoverToRemote bool default=false
-
#The name of the cluster (as specified in qr-searchers)
clusterName string
@@ -25,3 +19,12 @@ maxQueryTimeout double default=600
#The maximum query timeout allowed before disabling the backend query cache for the given query (default 10 seconds).
#Note that the query timeout is used as the query cache timeout in the backend if enabled.
maxQueryCacheTimeout double default=10
+
+#The configid to use to get other clusterspecific configs.
+configid string default=""
+
+#The mbus route to the backing content cluster
+storageRoute string default=""
+
+#Indexing mode for this cluster. This is a temporary workaround until this is correctly resolved per schema all over.
+indexMode enum {INDEX, STREAMING, STORE_ONLY} default = INDEX
diff --git a/container-search/src/test/java/com/yahoo/prelude/cluster/ClusterSearcherTestCase.java b/container-search/src/test/java/com/yahoo/prelude/cluster/ClusterSearcherTestCase.java
index 4adbce3add9..1668edd081f 100644
--- a/container-search/src/test/java/com/yahoo/prelude/cluster/ClusterSearcherTestCase.java
+++ b/container-search/src/test/java/com/yahoo/prelude/cluster/ClusterSearcherTestCase.java
@@ -488,7 +488,6 @@ public class ClusterSearcherTestCase {
return new ClusterSearcher(new ComponentId("test-id"),
new InThreadExecutorService(),
- qrSearchersConfig.build(),
clusterConfig.build(),
documentDbConfig.build(),
new SchemaInfo(List.of(schema.build()), List.of()),
diff --git a/container-search/src/test/java/com/yahoo/prelude/searcher/test/ValidateSortingSearcherTestCase.java b/container-search/src/test/java/com/yahoo/prelude/searcher/test/ValidateSortingSearcherTestCase.java
index 7b0e1867650..b889119171e 100644
--- a/container-search/src/test/java/com/yahoo/prelude/searcher/test/ValidateSortingSearcherTestCase.java
+++ b/container-search/src/test/java/com/yahoo/prelude/searcher/test/ValidateSortingSearcherTestCase.java
@@ -3,7 +3,6 @@ package com.yahoo.prelude.searcher.test;
import com.yahoo.component.chain.Chain;
import com.yahoo.config.subscription.ConfigGetter;
-import com.yahoo.container.QrSearchersConfig;
import com.yahoo.prelude.searcher.ValidateSortingSearcher;
import com.yahoo.search.Query;
import com.yahoo.search.Result;
@@ -30,14 +29,10 @@ public class ValidateSortingSearcherTestCase {
@SuppressWarnings("deprecation")
public ValidateSortingSearcherTestCase() {
- QrSearchersConfig.Builder qrsCfg = new QrSearchersConfig.Builder();
- qrsCfg.searchcluster(new QrSearchersConfig.Searchcluster.Builder().name("giraffes"));
- ClusterConfig.Builder clusterCfg = new ClusterConfig.Builder().
- clusterId(0).
- clusterName("test");
+ ClusterConfig.Builder clusterCfg = new ClusterConfig.Builder()
+ .clusterName("giraffes");
String attributesCfg = "file:src/test/java/com/yahoo/prelude/searcher/test/validate_sorting.cfg";
- searcher = new ValidateSortingSearcher(new QrSearchersConfig(qrsCfg),
- new ClusterConfig(clusterCfg),
+ searcher = new ValidateSortingSearcher(new ClusterConfig(clusterCfg),
ConfigGetter.getConfig(AttributesConfig.class, attributesCfg));
}
@@ -82,7 +77,6 @@ public class ValidateSortingSearcherTestCase {
return transform(QueryTestCase.httpEncode(sorting), null);
}
- @SuppressWarnings("deprecation")
private String transform(String sorting, String language) {
String q = "/?query=a";
if (sorting != null) {
diff --git a/container-search/src/test/java/com/yahoo/search/grouping/GroupingValidatorTestCase.java b/container-search/src/test/java/com/yahoo/search/grouping/GroupingValidatorTestCase.java
index fbab022c084..edce8112f21 100644
--- a/container-search/src/test/java/com/yahoo/search/grouping/GroupingValidatorTestCase.java
+++ b/container-search/src/test/java/com/yahoo/search/grouping/GroupingValidatorTestCase.java
@@ -2,7 +2,6 @@
package com.yahoo.search.grouping;
import com.yahoo.vespa.config.search.AttributesConfig;
-import com.yahoo.container.QrSearchersConfig;
import com.yahoo.search.Query;
import com.yahoo.search.config.ClusterConfig;
import com.yahoo.search.grouping.request.GroupingOperation;
@@ -191,17 +190,11 @@ public class GroupingValidatorTestCase {
}
private static void validateGrouping(String clusterName, AttributesConfig attributesConfig, Query query) {
- QrSearchersConfig.Builder qrsConfig = new QrSearchersConfig.Builder().searchcluster(
- new QrSearchersConfig.Searchcluster.Builder()
- .indexingmode(QrSearchersConfig.Searchcluster.Indexingmode.Enum.REALTIME)
- .name(clusterName));
- ClusterConfig.Builder clusterConfig = new ClusterConfig.Builder().
- clusterId(0).
- clusterName("test");
- new Execution(
- new GroupingValidator(new QrSearchersConfig(qrsConfig),
- new ClusterConfig(clusterConfig),
- attributesConfig),
- Execution.Context.createContextStub()).search(query);
+ ClusterConfig.Builder clusterConfig = new ClusterConfig.Builder()
+ .clusterName(clusterName)
+ .indexMode(ClusterConfig.IndexMode.Enum.INDEX);
+ new Execution(new GroupingValidator(clusterConfig.build(), attributesConfig),
+ Execution.Context.createContextStub())
+ .search(query);
}
}