Search in sources :

Example 1 with IndexschemaConfig

use of com.yahoo.vespa.config.search.IndexschemaConfig 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 2 with IndexschemaConfig

use of com.yahoo.vespa.config.search.IndexschemaConfig 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

AttributesConfig (com.yahoo.vespa.config.search.AttributesConfig)2 IndexschemaConfig (com.yahoo.vespa.config.search.IndexschemaConfig)2 RankProfilesConfig (com.yahoo.vespa.config.search.RankProfilesConfig)2 AbstractConfigProducer (com.yahoo.config.model.producer.AbstractConfigProducer)1 ImportedFieldsConfig (com.yahoo.vespa.config.search.ImportedFieldsConfig)1 RankingConstantsConfig (com.yahoo.vespa.config.search.core.RankingConstantsConfig)1