use of com.yahoo.searchdefinition.SearchBuilder in project vespa by vespa-engine.
the class ClusterTest method newSearchDefinition.
private static SearchDefinition newSearchDefinition(String name) throws ParseException {
SearchBuilder builder = new SearchBuilder();
builder.importString("search " + name + " { document " + name + " { } }");
builder.build();
return new SearchDefinition(name, builder.getSearch(name));
}
use of com.yahoo.searchdefinition.SearchBuilder in project vespa by vespa-engine.
the class InheritanceTestCase method testInheritance.
@Test
public void testInheritance() throws IOException, ParseException {
String dir = "src/test/derived/inheritance/";
SearchBuilder builder = new SearchBuilder();
builder.importFile(dir + "grandparent.sd");
builder.importFile(dir + "father.sd");
builder.importFile(dir + "mother.sd");
builder.importFile(dir + "child.sd");
builder.build();
derive("inheritance", builder, builder.getSearch("child"));
assertCorrectConfigFiles("inheritance");
}
use of com.yahoo.searchdefinition.SearchBuilder in project vespa by vespa-engine.
the class InheritanceTestCase method requireThatStructTypesAreInheritedFromParent.
@Test
public void requireThatStructTypesAreInheritedFromParent() throws IOException, ParseException {
String dir = "src/test/derived/inheritfromparent/";
SearchBuilder builder = new SearchBuilder();
builder.importFile(dir + "parent.sd");
builder.importFile(dir + "child.sd");
builder.build();
derive("inheritfromparent", builder, builder.getSearch("child"));
assertCorrectConfigFiles("inheritfromparent");
}
use of com.yahoo.searchdefinition.SearchBuilder in project vespa by vespa-engine.
the class SummaryTestCase method buildCampaignAdModel.
private static Search buildCampaignAdModel() throws ParseException {
SearchBuilder builder = new SearchBuilder();
builder.importString("search campaign { document campaign {} }");
builder.importString(joinLines("search ad {", " document ad {", " field campaign_ref type reference<campaign> {", " indexing: summary | attribute", " }", " field other_campaign_ref type reference<campaign> {", " indexing: summary | attribute", " }", " }", " document-summary my_summary {", " summary other_campaign_ref type reference<campaign> {}", " }", "}"));
builder.build();
return builder.getSearch("ad");
}
use of com.yahoo.searchdefinition.SearchBuilder in project vespa by vespa-engine.
the class SimpleInheritTestCase method testEmptyChild.
@Test
public void testEmptyChild() throws IOException, ParseException {
String name = "emptychild";
final String expectedResultsDirName = "src/test/derived/" + name + "/";
SearchBuilder builder = new SearchBuilder();
builder.importFile(expectedResultsDirName + "parent.sd");
builder.importFile(expectedResultsDirName + "child.sd");
builder.build();
Search search = builder.getSearch("child");
String toDirName = "temp/" + name;
File toDir = new File(toDirName);
toDir.mkdirs();
deleteContent(toDir);
DerivedConfiguration config = new DerivedConfiguration(search, builder.getRankProfileRegistry(), new QueryProfileRegistry());
config.export(toDirName);
checkDir(toDirName, expectedResultsDirName);
}
Aggregations