aboutsummaryrefslogtreecommitdiffstats
path: root/container-search
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@oath.com>2019-12-30 13:27:48 +0100
committerGitHub <noreply@github.com>2019-12-30 13:27:48 +0100
commitdc6d63755cda1bf8b8ecfc1adbadba09336bfd73 (patch)
tree36cb0cd8a9e4d84ddd5b42278cfc5f90f874fe9d /container-search
parent729fe27b010f75179f03778094b27033cee446f6 (diff)
parentdb8b48fab7f52f11e53e0816d203374b1cfe34ad (diff)
Merge pull request #11569 from vespa-engine/bratseth/convenience-method
Add convenience method
Diffstat (limited to 'container-search')
-rw-r--r--container-search/abi-spec.json1
-rw-r--r--container-search/src/main/java/com/yahoo/search/searchchain/ExecutionFactory.java9
2 files changed, 10 insertions, 0 deletions
diff --git a/container-search/abi-spec.json b/container-search/abi-spec.json
index 66502b62ee8..0f55f777250 100644
--- a/container-search/abi-spec.json
+++ b/container-search/abi-spec.json
@@ -7741,6 +7741,7 @@
"methods": [
"public void <init>(com.yahoo.container.core.ChainsConfig, com.yahoo.search.config.IndexInfoConfig, com.yahoo.container.QrSearchersConfig, com.yahoo.component.provider.ComponentRegistry, com.yahoo.vespa.configdefinition.SpecialtokensConfig, com.yahoo.language.Linguistics, com.yahoo.component.provider.ComponentRegistry)",
"public com.yahoo.search.searchchain.Execution newExecution(com.yahoo.component.chain.Chain)",
+ "public com.yahoo.search.searchchain.Execution newExecution(java.lang.String)",
"public com.yahoo.search.searchchain.SearchChainRegistry searchChainRegistry()",
"public com.yahoo.search.rendering.RendererRegistry rendererRegistry()",
"public void deconstruct()",
diff --git a/container-search/src/main/java/com/yahoo/search/searchchain/ExecutionFactory.java b/container-search/src/main/java/com/yahoo/search/searchchain/ExecutionFactory.java
index c619bf69e59..31b6d06f78e 100644
--- a/container-search/src/main/java/com/yahoo/search/searchchain/ExecutionFactory.java
+++ b/container-search/src/main/java/com/yahoo/search/searchchain/ExecutionFactory.java
@@ -66,6 +66,15 @@ public class ExecutionFactory extends AbstractComponent {
new Execution.Context(searchChainRegistry, indexFacts, specialTokens, rendererRegistry, linguistics));
}
+ /**
+ * Creates a new execution starting at a search chain.
+ * An execution instance should be used once to execute a (tree of) search chains.
+ */
+ public Execution newExecution(String searchChainId) {
+ return new Execution(searchChainRegistry().getChain(searchChainId),
+ new Execution.Context(searchChainRegistry, indexFacts, specialTokens, rendererRegistry, linguistics));
+ }
+
/** Returns the search chain registry used by this */
public SearchChainRegistry searchChainRegistry() { return searchChainRegistry; }