use of com.yahoo.vespa.model.container.search.ContainerSearch in project vespa by vespa-engine.
the class ContainerDocumentApi method setupLegacySearchers.
private void setupLegacySearchers(ContainerCluster cluster) {
Set<ComponentSpecification> inherited = new TreeSet<>();
SearchChain vespaGetChain = new SearchChain(new ChainSpecification(new ComponentId("vespaget"), new ChainSpecification.Inheritance(inherited, null), new ArrayList<>(), new TreeSet<>()));
vespaGetChain.addInnerComponent(newVespaClientSearcher("com.yahoo.storage.searcher.GetSearcher"));
SearchChain vespaVisitChain = new SearchChain(new ChainSpecification(new ComponentId("vespavisit"), new ChainSpecification.Inheritance(inherited, null), new ArrayList<>(), new TreeSet<>()));
vespaVisitChain.addInnerComponent(newVespaClientSearcher("com.yahoo.storage.searcher.VisitSearcher"));
SearchChains chains;
if (cluster.getSearch() != null) {
chains = cluster.getSearchChains();
} else {
chains = new SearchChains(cluster, "searchchain");
}
chains.add(vespaGetChain);
chains.add(vespaVisitChain);
if (cluster.getSearch() == null) {
ContainerSearch containerSearch = new ContainerSearch(cluster, chains, new ContainerSearch.Options());
cluster.setSearch(containerSearch);
ProcessingHandler<SearchChains> searchHandler = new ProcessingHandler<>(chains, "com.yahoo.search.handler.SearchHandler");
searchHandler.addServerBindings("http://*/search/*", "https://*/search/*");
cluster.addComponent(searchHandler);
}
}
use of com.yahoo.vespa.model.container.search.ContainerSearch in project vespa by vespa-engine.
the class ContainerModelBuilder method buildSearch.
private ContainerSearch buildSearch(ContainerCluster containerCluster, Element producerSpec, QueryProfiles queryProfiles, SemanticRules semanticRules) {
SearchChains searchChains = new DomSearchChainsBuilder(null, false).build(containerCluster, producerSpec);
ContainerSearch containerSearch = new ContainerSearch(containerCluster, searchChains, new ContainerSearch.Options());
applyApplicationPackageDirectoryConfigs(containerCluster.getRoot().getDeployState().getApplicationPackage(), containerSearch);
containerSearch.setQueryProfiles(queryProfiles);
containerSearch.setSemanticRules(semanticRules);
return containerSearch;
}
use of com.yahoo.vespa.model.container.search.ContainerSearch in project vespa by vespa-engine.
the class ContainerClusterTest method createContainerCluster.
private ContainerCluster createContainerCluster(boolean isHosted, boolean isCombinedCluster, Optional<Integer> memoryPercentage, Optional<ContainerClusterVerifier> extraComponents) {
DeployState state = new DeployState.Builder().properties(new DeployProperties.Builder().hostedVespa(isHosted).build()).build(true);
MockRoot root = new MockRoot("foo", state);
ContainerCluster cluster = extraComponents.isPresent() ? new ContainerCluster(root, "container0", "container1", extraComponents.get()) : new ContainerCluster(root, "container0", "container1");
if (isCombinedCluster)
cluster.setHostClusterId("test-content-cluster");
cluster.setMemoryPercentage(memoryPercentage);
cluster.setSearch(new ContainerSearch(cluster, new SearchChains(cluster, "search-chain"), new ContainerSearch.Options()));
return cluster;
}
Aggregations