use of com.yahoo.searchdefinition.document.SDDocumentType in project vespa by vespa-engine.
the class SearchOrdererTestCase method createSearchDefinition.
private static Search createSearchDefinition(String name, Map<String, Search> searchDefinitions) {
Search search = new Search(name, null);
SDDocumentType document = new SDDocumentType(name);
document.setDocumentReferences(new DocumentReferences(emptyMap()));
search.addDocument(document);
searchDefinitions.put(search.getName(), search);
return search;
}
use of com.yahoo.searchdefinition.document.SDDocumentType in project vespa by vespa-engine.
the class TypeConversionTestCase method testExactStringToStringTypeConversion.
/**
* Tests that exact-string stuff is not spilled over to the default index
*/
@Test
public void testExactStringToStringTypeConversion() {
Search search = new Search("test", null);
RankProfileRegistry rankProfileRegistry = RankProfileRegistry.createRankProfileRegistryWithBuiltinRankProfiles(search);
SDDocumentType document = new SDDocumentType("test");
search.addDocument(document);
SDField a = new SDField("a", DataType.STRING);
a.parseIndexingScript("{ index }");
document.addField(a);
Processing.process(search, new BaseDeployLogger(), rankProfileRegistry, new QueryProfiles(), true);
DerivedConfiguration derived = new DerivedConfiguration(search, rankProfileRegistry, new QueryProfileRegistry());
IndexInfo indexInfo = derived.getIndexInfo();
assertFalse(indexInfo.hasCommand("default", "compact-to-term"));
}
use of com.yahoo.searchdefinition.document.SDDocumentType in project vespa by vespa-engine.
the class ImplicitSearchFieldsTestCase method testRequireThatSummaryFieldsAreIncluded.
@Test
public void testRequireThatSummaryFieldsAreIncluded() throws IOException, ParseException {
Search search = SearchBuilder.buildFromFile("src/test/examples/nextgen/summaryfield.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"));
assertNotNull(docType.getField("cox"));
assertEquals(5, docType.getFieldCount());
}
use of com.yahoo.searchdefinition.document.SDDocumentType in project vespa by vespa-engine.
the class ImplicitSearchFieldsTestCase method testRequireThatBoldedSummaryFieldsAreIncluded.
@Test
public void testRequireThatBoldedSummaryFieldsAreIncluded() throws IOException, ParseException {
Search search = SearchBuilder.buildFromFile("src/test/examples/nextgen/boldedsummaryfields.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"));
assertNotNull(docType.getField("baz"));
assertNotNull(docType.getField("cox"));
assertEquals(6, docType.getFieldCount());
}
use of com.yahoo.searchdefinition.document.SDDocumentType in project vespa by vespa-engine.
the class ValidateFieldTypesTest method createSearchWithDocument.
private static Search createSearchWithDocument(String documentName) {
Search search = new Search(documentName, MockApplicationPackage.createEmpty());
SDDocumentType document = new SDDocumentType(documentName, search);
search.addDocument(document);
return search;
}
Aggregations