aboutsummaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo
diff options
context:
space:
mode:
Diffstat (limited to 'container-search/src/main/java/com/yahoo')
-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
4 files changed, 18 insertions, 46 deletions
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;