DocumentAccess access = DocumentAccess.createDefault();
DocumentType type = access.getDocumentTypeManager().getDocumentType("location");
DocumentId id = new DocumentId("id:location:location::4");
Document document = new Document(type, id);
document.setFieldValue(document.getDataType().getField("token"), "qwerty");
**document.setFieldValue(document.getDataType().getField("latlong"),"N28.6273348;E77.4327459");**
document.setFieldValue(document.getDataType().getField("data_timestamp"), "00:00:00 00:00:00");
添加 Position 类型的 latlong 字段时,我在搜索 API 中收到此错误。
"message": "Invalid search request [/search/?query=dcnQ8ar52Y]: Type class com.yahoo.document.datatypes.StringFieldValue can not specify a class com.yahoo.document.datatypes.Struct instance"