Search in sources :

Example 1 with RankProfilesConfig

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);
}
Also used : SummaryConfig(com.yahoo.vespa.config.search.SummaryConfig) DocumentdbInfoConfig(com.yahoo.prelude.fastsearch.DocumentdbInfoConfig) RankProfilesConfig(com.yahoo.vespa.config.search.RankProfilesConfig)

Example 2 with RankProfilesConfig

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);
    }
}
Also used : DocumentdbInfoConfig(com.yahoo.prelude.fastsearch.DocumentdbInfoConfig) RankProfilesConfig(com.yahoo.vespa.config.search.RankProfilesConfig)

Example 3 with RankProfilesConfig

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));
}
Also used : RankProfilesConfig(com.yahoo.vespa.config.search.RankProfilesConfig) TestRoot(com.yahoo.config.model.test.TestRoot) File(java.io.File) TestDriver(com.yahoo.config.model.test.TestDriver) Test(org.junit.Test)

Example 4 with RankProfilesConfig

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());
}
Also used : IndexschemaConfig(com.yahoo.vespa.config.search.IndexschemaConfig) RankProfilesConfig(com.yahoo.vespa.config.search.RankProfilesConfig) AttributesConfig(com.yahoo.vespa.config.search.AttributesConfig)

Example 5 with RankProfilesConfig

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);
}
Also used : AbstractConfigProducer(com.yahoo.config.model.producer.AbstractConfigProducer) ImportedFieldsConfig(com.yahoo.vespa.config.search.ImportedFieldsConfig) RankProfilesConfig(com.yahoo.vespa.config.search.RankProfilesConfig) IndexschemaConfig(com.yahoo.vespa.config.search.IndexschemaConfig) AttributesConfig(com.yahoo.vespa.config.search.AttributesConfig) RankingConstantsConfig(com.yahoo.vespa.config.search.core.RankingConstantsConfig)

Aggregations

RankProfilesConfig (com.yahoo.vespa.config.search.RankProfilesConfig)5 DocumentdbInfoConfig (com.yahoo.prelude.fastsearch.DocumentdbInfoConfig)2 AttributesConfig (com.yahoo.vespa.config.search.AttributesConfig)2 IndexschemaConfig (com.yahoo.vespa.config.search.IndexschemaConfig)2 AbstractConfigProducer (com.yahoo.config.model.producer.AbstractConfigProducer)1 TestDriver (com.yahoo.config.model.test.TestDriver)1 TestRoot (com.yahoo.config.model.test.TestRoot)1 ImportedFieldsConfig (com.yahoo.vespa.config.search.ImportedFieldsConfig)1 SummaryConfig (com.yahoo.vespa.config.search.SummaryConfig)1 RankingConstantsConfig (com.yahoo.vespa.config.search.core.RankingConstantsConfig)1 File (java.io.File)1 Test (org.junit.Test)1