use of com.yahoo.search.searchchain.model.federation.FederationOptions in project vespa by vespa-engine.
the class FederationSearcher method addDefaultTargets.
private void addDefaultTargets(TargetResolver targetResolver, ComponentRegistry<SearchChain> searchChainRegistry) {
for (GenericTarget genericTarget : defaultTargets(searchChainRegistry.allComponents())) {
ComponentSpecification specification = genericTarget.getComponentId().toSpecification();
// Can't use genericTarget directly, as it might be part of a source group.
Target federationTarget = targetResolver.resolve(new TargetSpec(specification, new FederationOptions()));
// Do not replace manually added sources, as they might have manually configured federation options
if (!resolvedTargets.containsKey(federationTarget.id))
resolvedTargets.put(federationTarget.id, federationTarget);
}
}
use of com.yahoo.search.searchchain.model.federation.FederationOptions in project vespa by vespa-engine.
the class FederationSearcherTestCase method createMultiProviderFederationSearcher.
private FederationSearcher createMultiProviderFederationSearcher() {
FederationOptions options = new FederationOptions();
SearchChainResolver.Builder builder = new SearchChainResolver.Builder();
ComponentId provider1 = new ComponentId("provider1");
ComponentId provider2 = new ComponentId("provider2");
ComponentId news = new ComponentId("news");
builder.addSearchChain(provider1, options, Collections.<String>emptyList());
builder.addSearchChain(provider2, options, Collections.<String>emptyList());
builder.addSourceForProvider(news, provider1, provider1, true, options, Collections.<String>emptyList());
builder.addSourceForProvider(news, provider2, provider2, false, options, Collections.<String>emptyList());
return new FederationSearcher(new ComponentId("federation"), builder.build());
}
Aggregations