use of com.yahoo.vespa.model.search.AbstractSearchCluster in project vespa by vespa-engine.
the class ContainerModel method initialize.
@Override
@Deprecated
public void initialize(ConfigModelRepo configModelRepo) {
List<AbstractSearchCluster> searchClusters = Content.getSearchClusters(configModelRepo);
Map<String, AbstractSearchCluster> searchClustersByName = new TreeMap<>();
for (AbstractSearchCluster c : searchClusters) {
searchClustersByName.put(c.getClusterName(), c);
}
getCluster().initialize(searchClustersByName);
}
use of com.yahoo.vespa.model.search.AbstractSearchCluster in project vespa by vespa-engine.
the class NoPrefixForIndexes method validate.
@Override
public void validate(VespaModel model, DeployState deployState) {
for (AbstractSearchCluster cluster : model.getSearchClusters()) {
if (cluster instanceof IndexedSearchCluster) {
IndexedSearchCluster sc = (IndexedSearchCluster) cluster;
for (DocumentDatabase docDb : sc.getDocumentDbs()) {
DerivedConfiguration sdConfig = docDb.getDerivedConfiguration();
Search search = sdConfig.getSearch();
for (SDField field : search.allConcreteFields()) {
if (field.doesIndexing()) {
// if (!field.getIndexTo().isEmpty() && !field.getIndexTo().contains(field.getName())) continue;
if (field.getMatching().getAlgorithm().equals(Matching.Algorithm.PREFIX)) {
failField(search, field);
}
for (Map.Entry<String, Index> e : field.getIndices().entrySet()) {
if (e.getValue().isPrefix()) {
failField(search, field);
}
}
}
}
}
}
}
}
use of com.yahoo.vespa.model.search.AbstractSearchCluster in project vespa by vespa-engine.
the class RoutingSelectorValidator method validate.
@Override
public void validate(VespaModel model, DeployState deployState) {
for (AbstractSearchCluster cluster : model.getSearchClusters()) {
if (cluster instanceof IndexedSearchCluster) {
IndexedSearchCluster sc = (IndexedSearchCluster) cluster;
String routingSelector = sc.getRoutingSelector();
if (routingSelector == null)
continue;
try {
new DocumentSelector(routingSelector);
} catch (com.yahoo.document.select.parser.ParseException e) {
throw new IllegalArgumentException("Failed to parse routing selector for search cluster '" + sc.getClusterName() + "'", e);
}
}
}
}
Aggregations