use of com.yahoo.searchdefinition.document.SDDocumentType in project vespa by vespa-engine.
the class ImplicitSearchFieldsTestCase method testRequireThatDynamicSummaryFieldsAreIgnored.
@Test
public void testRequireThatDynamicSummaryFieldsAreIgnored() throws IOException, ParseException {
Search search = SearchBuilder.buildFromFile("src/test/examples/nextgen/dynamicsummaryfields.sd");
assertNotNull(search);
SDDocumentType docType = search.getDocument();
assertNotNull(docType);
assertNotNull(docType.getField("rankfeatures"));
assertNotNull(docType.getField("summaryfeatures"));
assertNotNull(docType.getField("foo"));
assertNotNull(docType.getField("bar"));
assertEquals(4, docType.getFieldCount());
}
use of com.yahoo.searchdefinition.document.SDDocumentType in project vespa by vespa-engine.
the class ImplicitSearchFieldsTestCase method testRequireThatExtraFieldsAreIncluded.
@Test
public void testRequireThatExtraFieldsAreIncluded() throws IOException, ParseException {
Search search = SearchBuilder.buildFromFile("src/test/examples/nextgen/extrafield.sd");
assertNotNull(search);
SDDocumentType docType = search.getDocument();
assertNotNull(docType);
assertNotNull(docType.getField("rankfeatures"));
assertNotNull(docType.getField("summaryfeatures"));
assertNotNull(docType.getField("foo"));
assertNotNull(docType.getField("bar"));
assertEquals(4, docType.getFieldCount());
}
use of com.yahoo.searchdefinition.document.SDDocumentType 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();
}
Aggregations