use of com.yahoo.vespa.config.search.RankProfilesConfig in project vespa by vespa-engine.
the class StreamingSearchCluster method getConfig.
@Override
public void getConfig(DocumentdbInfoConfig.Builder builder) {
DocumentdbInfoConfig.Documentdb.Builder docDb = new DocumentdbInfoConfig.Documentdb.Builder();
String searchName = sdConfig.getSearch().getName();
docDb.name(searchName);
SummaryConfig.Producer prod = sdConfig.getSummaries();
convertSummaryConfig(prod, null, docDb);
RankProfilesConfig.Builder rpb = new RankProfilesConfig.Builder();
sdConfig.getRankProfileList().getConfig(rpb);
addRankProfilesConfig(docDb, new RankProfilesConfig(rpb));
builder.documentdb(docDb);
}
use of com.yahoo.vespa.config.search.RankProfilesConfig in project vespa by vespa-engine.
the class IndexedSearchCluster method getConfig.
@Override
public void getConfig(DocumentdbInfoConfig.Builder builder) {
for (DocumentDatabase db : documentDbs) {
DocumentdbInfoConfig.Documentdb.Builder docDb = new DocumentdbInfoConfig.Documentdb.Builder();
docDb.name(db.getName());
convertSummaryConfig(db, db, docDb);
RankProfilesConfig.Builder rpb = new RankProfilesConfig.Builder();
db.getConfig(rpb);
addRankProfilesConfig(docDb, new RankProfilesConfig(rpb));
builder.documentdb(docDb);
}
}
use of com.yahoo.vespa.config.search.RankProfilesConfig in project vespa by vespa-engine.
the class RankProfileRegistryTest method testRankProfileInheritance.
@Test
public void testRankProfileInheritance() {
TestRoot root = new TestDriver().buildModel(FilesApplicationPackage.fromFile(new File(TESTDIR)));
RankProfilesConfig left = root.getConfig(RankProfilesConfig.class, "inherit/search/cluster.inherit/left");
RankProfilesConfig right = root.getConfig(RankProfilesConfig.class, "inherit/search/cluster.inherit/right");
assertThat(left.rankprofile().size(), is(3));
assertThat(right.rankprofile().size(), is(2));
}
use of com.yahoo.vespa.config.search.RankProfilesConfig in project vespa by vespa-engine.
the class DocumentDatabaseTestCase method assertDocTypeConfig.
private void assertDocTypeConfig(VespaModel model, String configId, String indexField, String attributeField) {
IndexschemaConfig icfg = model.getConfig(IndexschemaConfig.class, configId);
assertEquals(1, icfg.indexfield().size());
assertEquals(indexField, icfg.indexfield(0).name());
AttributesConfig acfg = model.getConfig(AttributesConfig.class, configId);
assertEquals(2, acfg.attribute().size());
assertEquals(attributeField, acfg.attribute(0).name());
assertEquals(attributeField + "_nfa", acfg.attribute(1).name());
RankProfilesConfig rcfg = model.getConfig(RankProfilesConfig.class, configId);
assertEquals(6, rcfg.rankprofile().size());
}
use of com.yahoo.vespa.config.search.RankProfilesConfig in project vespa by vespa-engine.
the class RankSetupValidator method writeConfigs.
private void writeConfigs(String dir, AbstractConfigProducer producer) throws IOException {
RankProfilesConfig.Builder rpcb = new RankProfilesConfig.Builder();
RankProfilesConfig.Producer.class.cast(producer).getConfig(rpcb);
RankProfilesConfig rpc = new RankProfilesConfig(rpcb);
writeConfig(dir, RankProfilesConfig.getDefName() + ".cfg", rpc);
IndexschemaConfig.Builder iscb = new IndexschemaConfig.Builder();
IndexschemaConfig.Producer.class.cast(producer).getConfig(iscb);
IndexschemaConfig isc = new IndexschemaConfig(iscb);
writeConfig(dir, IndexschemaConfig.getDefName() + ".cfg", isc);
AttributesConfig.Builder acb = new AttributesConfig.Builder();
AttributesConfig.Producer.class.cast(producer).getConfig(acb);
AttributesConfig ac = new AttributesConfig(acb);
writeConfig(dir, AttributesConfig.getDefName() + ".cfg", ac);
RankingConstantsConfig.Builder rccb = new RankingConstantsConfig.Builder();
RankingConstantsConfig.Producer.class.cast(producer).getConfig(rccb);
RankingConstantsConfig rcc = new RankingConstantsConfig(rccb);
writeConfig(dir, RankingConstantsConfig.getDefName() + ".cfg", rcc);
ImportedFieldsConfig.Builder ifcb = new ImportedFieldsConfig.Builder();
ImportedFieldsConfig.Producer.class.cast(producer).getConfig(ifcb);
ImportedFieldsConfig ifc = new ImportedFieldsConfig(ifcb);
writeConfig(dir, ImportedFieldsConfig.getDefName() + ".cfg", ifc);
}
Aggregations