use of com.yahoo.vespa.model.search.DocumentDatabase in project vespa by vespa-engine.
the class RankSetupValidator method validate.
@Override
public void validate(VespaModel model, DeployState deployState) {
try {
File cfgDir = Files.createTempDirectory("deploy_ranksetup").toFile();
for (AbstractSearchCluster cluster : model.getSearchClusters()) {
// Skipping rank expression checking for streaming clusters, not implemented yet
if (cluster.isRealtime()) {
IndexedSearchCluster sc = (IndexedSearchCluster) cluster;
String clusterDir = cfgDir.getAbsolutePath() + "/" + sc.getClusterName() + "/";
for (DocumentDatabase docDb : sc.getDocumentDbs()) {
final String name = docDb.getDerivedConfiguration().getSearch().getName();
String searchDir = clusterDir + name + "/";
writeConfigs(searchDir, docDb);
if (!validate("dir:" + searchDir, sc, name, deployState.getDeployLogger(), cfgDir)) {
return;
}
}
}
}
deleteTempDir(cfgDir);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
use of com.yahoo.vespa.model.search.DocumentDatabase in project vespa by vespa-engine.
the class IndexedSearchClusterChangeValidator method validateDocumentDatabases.
private static List<ConfigChangeAction> validateDocumentDatabases(ContentCluster currentCluster, ContentCluster nextCluster, ValidationOverrides overrides, Instant now) {
List<ConfigChangeAction> result = new ArrayList<>();
for (DocumentDatabase currentDb : getDocumentDbs(currentCluster.getSearch())) {
String docTypeName = currentDb.getName();
Optional<DocumentDatabase> nextDb = nextCluster.getSearch().getIndexed().getDocumentDbs().stream().filter(db -> db.getName().equals(docTypeName)).findFirst();
if (nextDb.isPresent()) {
result.addAll(validateDocumentDatabase(currentCluster, nextCluster, docTypeName, currentDb, nextDb.get(), overrides, now));
}
}
return result;
}
use of com.yahoo.vespa.model.search.DocumentDatabase 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);
}
}
}
}
}
}
}
}
Aggregations