Using Jackson to interface to Amazon CloudSearch, which ingests data in the format SDF. Here is an example:
[ {
"type" : "add",
"id" : "images_to_search_csv_1",
"version" : 1336526759,
"lang" : "en",
"fields" : {
"content" : "http://upload.wikimedia.org/wikipedia/commons/thumb/4/43/Timba%2B1.jpg/220px-Timba%2B1.jpg",
"title" : "Simba",
"source" : "wikipedia",
"description" : "Simba the wolf dog.",
"type" : "Image"
}
}, {
"type" : "add",
"id" : "images_to_search_csv_2",
"version" : 1336526760,
"lang" : "en",
"fields" : {
"content" : "http://www.wolfzone1.com/photos/sedona-01d%20copy.jpg",
"title" : "Wolf",
"source" : "Wolf Zone",
"description" : "Another wolf.",
"type" : "Image"
}
} ]
Notice that the fields are fields of the entity that you are submitting. So clearly, if you just bind that entity to the SDF class, you get the entity and then its fields but the structure of the file ends up different. Should I just write the code to output this by hand rather than have Jackson do it?