use of com.yahoo.searchdefinition.DocumentReferences in project vespa by vespa-engine.
the class SearchOrdererTestCase method createDocumentReference.
private static void createDocumentReference(Search from, Search to, String refFieldName) {
SDField refField = new TemporarySDField(refFieldName, ReferenceDataType.createWithInferredId(TemporaryStructuredDataType.create(to.getName())));
SDDocumentType fromDocument = from.getDocument();
fromDocument.addField(refField);
Map<String, DocumentReference> originalMap = fromDocument.getDocumentReferences().get().referenceMap();
HashMap<String, DocumentReference> modifiedMap = new HashMap<>(originalMap);
modifiedMap.put(refFieldName, new DocumentReference(refField, to));
fromDocument.setDocumentReferences(new DocumentReferences(modifiedMap));
}
use of com.yahoo.searchdefinition.DocumentReferences 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;
}
Aggregations