Search in sources :

Example 1 with SummaryConfig

use of com.yahoo.vespa.config.search.SummaryConfig in project vespa by vespa-engine.

the class SearchCluster method convertSummaryConfig.

/**
 * Converts summary and summary map config to the appropriate information in documentdb
 *
 * @param summaryConfigProducer the summary config
 * @param summarymapConfigProducer the summary map config, or null if none is available
 * @param docDb the target document dm config
 */
protected void convertSummaryConfig(SummaryConfig.Producer summaryConfigProducer, SummarymapConfig.Producer summarymapConfigProducer, DocumentdbInfoConfig.Documentdb.Builder docDb) {
    SummaryConfig.Builder summaryConfigBuilder = new SummaryConfig.Builder();
    summaryConfigProducer.getConfig(summaryConfigBuilder);
    SummaryConfig summaryConfig = new SummaryConfig(summaryConfigBuilder);
    SummarymapConfig summarymapConfig = null;
    if (summarymapConfigProducer != null) {
        SummarymapConfig.Builder summarymapConfigBuilder = new SummarymapConfig.Builder();
        summarymapConfigProducer.getConfig(summarymapConfigBuilder);
        summarymapConfig = new SummarymapConfig(summarymapConfigBuilder);
    }
    for (SummaryConfig.Classes sclass : summaryConfig.classes()) {
        DocumentdbInfoConfig.Documentdb.Summaryclass.Builder sumClassBuilder = new DocumentdbInfoConfig.Documentdb.Summaryclass.Builder();
        sumClassBuilder.id(sclass.id()).name(sclass.name());
        for (SummaryConfig.Classes.Fields field : sclass.fields()) {
            DocumentdbInfoConfig.Documentdb.Summaryclass.Fields.Builder fieldsBuilder = new DocumentdbInfoConfig.Documentdb.Summaryclass.Fields.Builder();
            fieldsBuilder.name(field.name()).type(field.type()).dynamic(isDynamic(field.name(), summarymapConfig));
            sumClassBuilder.fields(fieldsBuilder);
        }
        docDb.summaryclass(sumClassBuilder);
    }
}
Also used : SummarymapConfig(com.yahoo.vespa.config.search.SummarymapConfig) SummaryConfig(com.yahoo.vespa.config.search.SummaryConfig) DocumentdbInfoConfig(com.yahoo.prelude.fastsearch.DocumentdbInfoConfig)

Aggregations

DocumentdbInfoConfig (com.yahoo.prelude.fastsearch.DocumentdbInfoConfig)1 SummaryConfig (com.yahoo.vespa.config.search.SummaryConfig)1 SummarymapConfig (com.yahoo.vespa.config.search.SummarymapConfig)1