Search in sources :

Example 1 with SearchChains

use of com.yahoo.vespa.model.container.search.searchchain.SearchChains 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);
    }
}
Also used : SearchChains(com.yahoo.vespa.model.container.search.searchchain.SearchChains) ComponentSpecification(com.yahoo.component.ComponentSpecification) ProcessingHandler(com.yahoo.vespa.model.container.component.chain.ProcessingHandler) ContainerSearch(com.yahoo.vespa.model.container.search.ContainerSearch) ChainSpecification(com.yahoo.component.chain.model.ChainSpecification) ArrayList(java.util.ArrayList) SearchChain(com.yahoo.vespa.model.container.search.searchchain.SearchChain) TreeSet(java.util.TreeSet) ComponentId(com.yahoo.component.ComponentId)

Example 2 with SearchChains

use of com.yahoo.vespa.model.container.search.searchchain.SearchChains 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;
}
Also used : SearchChains(com.yahoo.vespa.model.container.search.searchchain.SearchChains) DomSearchChainsBuilder(com.yahoo.vespa.model.builder.xml.dom.chains.search.DomSearchChainsBuilder) ContainerSearch(com.yahoo.vespa.model.container.search.ContainerSearch)

Example 3 with SearchChains

use of com.yahoo.vespa.model.container.search.searchchain.SearchChains 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;
}
Also used : SearchChains(com.yahoo.vespa.model.container.search.searchchain.SearchChains) DeployState(com.yahoo.config.model.deploy.DeployState) MockRoot(com.yahoo.config.model.test.MockRoot) ContainerSearch(com.yahoo.vespa.model.container.search.ContainerSearch)

Aggregations

ContainerSearch (com.yahoo.vespa.model.container.search.ContainerSearch)3 SearchChains (com.yahoo.vespa.model.container.search.searchchain.SearchChains)3 ComponentId (com.yahoo.component.ComponentId)1 ComponentSpecification (com.yahoo.component.ComponentSpecification)1 ChainSpecification (com.yahoo.component.chain.model.ChainSpecification)1 DeployState (com.yahoo.config.model.deploy.DeployState)1 MockRoot (com.yahoo.config.model.test.MockRoot)1 DomSearchChainsBuilder (com.yahoo.vespa.model.builder.xml.dom.chains.search.DomSearchChainsBuilder)1 ProcessingHandler (com.yahoo.vespa.model.container.component.chain.ProcessingHandler)1 SearchChain (com.yahoo.vespa.model.container.search.searchchain.SearchChain)1 ArrayList (java.util.ArrayList)1 TreeSet (java.util.TreeSet)1