use of com.yahoo.document.DocumentType in project vespa by vespa-engine.
the class DocumentScriptTestCase method newFieldUpdate.
private static DocumentUpdate newFieldUpdate(FieldValue documentFieldValue, FieldValue extraFieldValue) {
DocumentType type = newDocumentType();
DocumentUpdate update = new DocumentUpdate(type, "doc:scheme:");
if (documentFieldValue != null) {
update.addFieldUpdate(FieldUpdate.createAssign(type.getField("documentField"), documentFieldValue));
}
if (extraFieldValue != null) {
update.addFieldUpdate(FieldUpdate.createAssign(type.getField("extraField"), extraFieldValue));
}
return update;
}
use of com.yahoo.document.DocumentType in project vespa by vespa-engine.
the class DocumentScriptTestCase method newPathUpdate.
private static DocumentUpdate newPathUpdate(FieldValue documentFieldValue, FieldValue extraFieldValue) {
DocumentType type = newDocumentType();
DocumentUpdate update = new DocumentUpdate(type, "doc:scheme:");
if (documentFieldValue != null) {
update.addFieldPathUpdate(new AssignFieldPathUpdate(type, "documentField", documentFieldValue));
}
if (extraFieldValue != null) {
update.addFieldPathUpdate(new AssignFieldPathUpdate(type, "extraField", extraFieldValue));
}
return update;
}
use of com.yahoo.document.DocumentType in project vespa by vespa-engine.
the class DocumentScriptTestCase method processFieldUpdate.
private static ValueUpdate<?> processFieldUpdate(FieldValue fieldValue) {
DocumentType docType = new DocumentType("myDocumentType");
docType.addField("myField", fieldValue.getDataType());
DocumentUpdate update = new DocumentUpdate(docType, "doc:scheme:");
update.addFieldUpdate(FieldUpdate.createAssign(docType.getField("myField"), fieldValue));
update = newScript(docType).execute(ADAPTER_FACTORY, update);
return update.getFieldUpdate("myField").getValueUpdate(0);
}
use of com.yahoo.document.DocumentType in project vespa by vespa-engine.
the class DocumentScriptTestCase method processDocument.
private static FieldValue processDocument(FieldValue fieldValue) {
DocumentType docType = new DocumentType("myDocumentType");
docType.addField("myField", fieldValue.getDataType());
Document doc = new Document(docType, "doc:scheme:");
doc.setFieldValue("myField", fieldValue.clone());
doc = newScript(docType).execute(ADAPTER_FACTORY, doc);
return doc.getFieldValue("myField");
}
use of com.yahoo.document.DocumentType in project vespa by vespa-engine.
the class DocumentScriptTestCase method processPathUpdate.
private static ValueUpdate<?> processPathUpdate(FieldValue fieldValue) {
DocumentType docType = new DocumentType("myDocumentType");
docType.addField("myField", fieldValue.getDataType());
DocumentUpdate update = new DocumentUpdate(docType, "doc:scheme:");
update.addFieldPathUpdate(new AssignFieldPathUpdate(docType, "myField", fieldValue));
update = newScript(docType).execute(ADAPTER_FACTORY, update);
return update.getFieldUpdate("myField").getValueUpdate(0);
}
Aggregations