Search in sources :

Example 6 with SearchCoverage

use of com.yahoo.vespa.model.content.SearchCoverage in project vespa by vespa-engine.

the class DomSearchCoverageBuilder method build.

public static SearchCoverage build(ModelElement contentXml) {
    SearchCoverage.Builder builder = new SearchCoverage.Builder();
    ModelElement searchElement = contentXml.getChild("search");
    if (searchElement == null) {
        return builder.build();
    }
    ModelElement coverageElement = searchElement.getChild("coverage");
    if (coverageElement == null) {
        return builder.build();
    }
    builder.setMinimum(coverageElement.childAsDouble("minimum"));
    builder.setMinWaitAfterCoverageFactor(coverageElement.childAsDouble("min-wait-after-coverage-factor"));
    builder.setMaxWaitAfterCoverageFactor(coverageElement.childAsDouble("max-wait-after-coverage-factor"));
    return builder.build();
}
Also used : ModelElement(com.yahoo.vespa.model.builder.xml.dom.ModelElement) SearchCoverage(com.yahoo.vespa.model.content.SearchCoverage)

Aggregations

SearchCoverage (com.yahoo.vespa.model.content.SearchCoverage)6 Test (org.junit.Test)4 PartitionsConfig (com.yahoo.vespa.config.search.core.PartitionsConfig)1 ModelElement (com.yahoo.vespa.model.builder.xml.dom.ModelElement)1 ArrayList (java.util.ArrayList)1