use of com.yahoo.vespa.model.content.ContentSearch in project vespa by vespa-engine.
the class DomContentSearchBuilder method build.
public static ContentSearch build(ModelElement contentXml) {
ContentSearch.Builder builder = new ContentSearch.Builder();
ModelElement searchElement = contentXml.getChild("search");
if (searchElement == null) {
return builder.build();
}
builder.setQueryTimeout(searchElement.childAsDouble("query-timeout"));
builder.setVisibilityDelay(searchElement.childAsDouble("visibility-delay"));
return builder.build();
}
use of com.yahoo.vespa.model.content.ContentSearch in project vespa by vespa-engine.
the class DomContentSearchBuilderTest method requireThatContentSearchCanBeBuilt.
@Test
public void requireThatContentSearchCanBeBuilt() throws Exception {
ContentSearch search = newContentSearch("<content>" + " <search>" + " <query-timeout>1.1</query-timeout>" + " <visibility-delay>2.3</visibility-delay>" + " </search>" + "</content>");
assertEquals(1.1, search.getQueryTimeout(), 1E-6);
assertEquals(2.3, search.getVisibilityDelay(), 1E-6);
}
use of com.yahoo.vespa.model.content.ContentSearch in project vespa by vespa-engine.
the class DomContentSearchBuilderTest method requireThatDefaultsAreNull.
@Test
public void requireThatDefaultsAreNull() throws Exception {
ContentSearch search = newContentSearch("<content/>");
assertNull(search.getVisibilityDelay());
assertNull(search.getQueryTimeout());
}
use of com.yahoo.vespa.model.content.ContentSearch in project vespa by vespa-engine.
the class DomContentSearchBuilderTest method requireThatEmptySearchIsSafe.
@Test
public void requireThatEmptySearchIsSafe() throws Exception {
ContentSearch search = newContentSearch("<content>" + " <search/>" + "</content>");
assertNull(search.getVisibilityDelay());
assertNull(search.getQueryTimeout());
}
Aggregations