use of com.yahoo.vespa.model.search.IndexedSearchCluster 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.IndexedSearchCluster in project vespa by vespa-engine.
the class Content method createTlds.
public void createTlds(ConfigModelRepo modelRepo) {
IndexedSearchCluster indexedCluster = cluster.getSearch().getIndexed();
if (indexedCluster == null)
return;
SimpleConfigProducer tldParent = new SimpleConfigProducer(indexedCluster, "tlds");
for (ConfigModel model : modelRepo.asMap().values()) {
if (!(model instanceof ContainerModel))
continue;
ContainerCluster containerCluster = ((ContainerModel) model).getCluster();
// this is not a qrs cluster
if (containerCluster.getSearch() == null)
continue;
log.log(LogLevel.DEBUG, "Adding tlds for indexed cluster " + indexedCluster.getClusterName() + ", container cluster " + containerCluster.getName());
indexedCluster.addTldsWithSameIdsAsContainers(tldParent, containerCluster);
}
indexedCluster.setupDispatchGroups();
}
use of com.yahoo.vespa.model.search.IndexedSearchCluster in project vespa by vespa-engine.
the class IndexedTest method requireMultipleDocumentTypes.
@Test
public void requireMultipleDocumentTypes() {
VespaModelCreatorWithMockPkg creator = getIndexedVespaModelCreator();
VespaModel model = creator.create();
DeployState deployState = creator.deployState;
IndexedSearchCluster cluster = model.getContentClusters().get("test").getSearch().getIndexed();
assertEquals(3, cluster.getDocumentDbs().size());
NewDocumentType type1 = deployState.getDocumentModel().getDocumentManager().getDocumentType("type1");
NewDocumentType type2 = deployState.getDocumentModel().getDocumentManager().getDocumentType("type2");
NewDocumentType type3 = deployState.getDocumentModel().getDocumentManager().getDocumentType("type3");
assertNotNull(type1);
assertNotNull(type2);
assertNotNull(type3);
}
use of com.yahoo.vespa.model.search.IndexedSearchCluster in project vespa by vespa-engine.
the class ClusterTest method requireThatContentSearchIsApplied.
@Test
public void requireThatContentSearchIsApplied() throws ParseException {
ContentCluster cluster = newContentCluster(joinLines("<search>", " <query-timeout>1.1</query-timeout>", " <visibility-delay>2.3</visibility-delay>", "</search>"));
IndexedSearchCluster searchCluster = cluster.getSearch().getIndexed();
assertNotNull(searchCluster);
assertEquals(1.1, searchCluster.getQueryTimeout(), 1E-6);
assertEquals(2.3, searchCluster.getVisibilityDelay(), 1E-6);
ProtonConfig proton = getProtonConfig(cluster);
assertEquals(searchCluster.getVisibilityDelay(), proton.documentdb(0).visibilitydelay(), 1E-6);
}
use of com.yahoo.vespa.model.search.IndexedSearchCluster 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