use of com.yahoo.vespa.model.builder.xml.dom.chains.search.DomSearchChainsBuilder 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.builder.xml.dom.chains.search.DomSearchChainsBuilder in project vespa by vespa-engine.
the class SearchChainsTestBase method setupSearchChains.
@Before
public void setupSearchChains() {
SearchChains searchChains = new DomSearchChainsBuilder().build(root, servicesXml());
searchChains.initialize(MockSearchClusters.twoMockClusterSpecsByName(root), new BinaryScaledAmount(100, BinaryPrefix.mega));
root.freezeModelTopology();
}
use of com.yahoo.vespa.model.builder.xml.dom.chains.search.DomSearchChainsBuilder in project vespa by vespa-engine.
the class SearchChainsTest2 method fail_upon_unresolved_inheritance.
@Test
public void fail_upon_unresolved_inheritance() {
final Element searchElem = DomBuilderTest.parse("<search>", " <chain id='default' inherits='nonexistent' />", "</search>");
try {
SearchChains chains = new DomSearchChainsBuilder().build(new MockRoot(), searchElem);
chains.validate();
fail("Expected exception when inheriting a nonexistent search chain.");
} catch (Exception e) {
assertThat(e.getMessage(), containsString("Missing chain 'nonexistent'"));
}
}
Aggregations