use of com.yahoo.searchdefinition.SearchBuilder in project vespa by vespa-engine.
the class TwoStreamingStructsTestCase method testTwoStreamingStructsExporting.
@Test
public void testTwoStreamingStructsExporting() throws ParseException, IOException {
String root = "src/test/derived/twostreamingstructs";
SearchBuilder builder = new SearchBuilder();
builder.importFile(root + "/streamingstruct.sd");
builder.importFile(root + "/whatever.sd");
builder.build();
assertCorrectDeriving(builder, builder.getSearch("streamingstruct"), root);
builder = new SearchBuilder();
builder.importFile(root + "/streamingstruct.sd");
builder.importFile(root + "/whatever.sd");
builder.build();
assertCorrectDeriving(builder, builder.getSearch("streamingstruct"), root);
}
use of com.yahoo.searchdefinition.SearchBuilder in project vespa by vespa-engine.
the class ImplicitSearchFieldsTestCase method testRequireThatDerivedConfigurationWorks.
@Test
public void testRequireThatDerivedConfigurationWorks() throws IOException, ParseException {
SearchBuilder sb = new SearchBuilder();
sb.importFile("src/test/examples/nextgen/simple.sd");
sb.build();
assertNotNull(sb.getSearch());
new DerivedConfiguration(sb.getSearch(), sb.getRankProfileRegistry(), new QueryProfileRegistry());
}
use of com.yahoo.searchdefinition.SearchBuilder in project vespa by vespa-engine.
the class AbstractExportingTestCase method derive.
protected DerivedConfiguration derive(String dirName, String searchDefinitionName) throws IOException, ParseException {
File toDir = new File(tempDir + dirName);
toDir.mkdirs();
deleteContent(toDir);
SearchBuilder builder = SearchBuilder.createFromDirectory(searchDefRoot + dirName + "/");
// SearchBuilder builder = SearchBuilder.createFromFile(searchDefDir + name + ".sd");
return derive(dirName, searchDefinitionName, builder);
}
use of com.yahoo.searchdefinition.SearchBuilder in project vespa by vespa-engine.
the class SearchClusterTest method testSdConfigLogical.
@Test
public void testSdConfigLogical() throws IOException, SAXException {
// sd1
SDDocumentType sdt1 = new SDDocumentType("s1");
Search search1 = new Search("s1", null);
SDField f1 = new SDField("f1", DataType.STRING);
f1.addAttribute(new Attribute("f1", DataType.STRING));
f1.setIndexingScript(new ScriptExpression(new StatementExpression(new AttributeExpression("f1"))));
sdt1.addField(f1);
search1.addDocument(sdt1);
// sd2
SDDocumentType sdt2 = new SDDocumentType("s2");
Search search2 = new Search("s2", null);
SDField f2 = new SDField("f2", DataType.STRING);
f2.addAttribute(new Attribute("f2", DataType.STRING));
f2.setIndexingScript(new ScriptExpression(new StatementExpression(new AttributeExpression("f2"))));
sdt2.addField(f2);
search2.addDocument(sdt2);
SearchBuilder builder = new SearchBuilder();
builder.importRawSearch(search1);
builder.importRawSearch(search2);
builder.build();
}
use of com.yahoo.searchdefinition.SearchBuilder in project vespa by vespa-engine.
the class ApplicationPackageUtils method createSearch.
public static Search createSearch(String name, String field1, String field2) throws ParseException {
SearchBuilder sb = new SearchBuilder();
sb.importString(generateSearchDefinition(name, field1, field2));
sb.build();
return sb.getSearch();
}
Aggregations