boolean att = (attach!=null) ? Integer.parseInt(doc.get("attach"))==1 : false;
SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
String sentDate = doc.get("sentdate");
Date sent = (sentDate!=null) ? format.parse(sentDate, new ParsePosition(1)) : new Date(0);
addMessage(new EmailID(uid), score, subject,to,from, sent, sz, att, pri);
} else {
// legacy index (all fields are taken from the email directly as opposed to the lucene index
addMessage(new EmailID(uid), score);
setFetchMessage(new LegacyFetchMessage());
}
}