boolean archiveDateFound = false;
Hashtable<String,EmailFieldValue> fields = message.getFields();
Enumeration e = fields.elements();
while (e.hasMoreElements()) {
EmailFieldValue efv = (EmailFieldValue)e.nextElement();
String fieldName = efv.getField().getName();
String fieldValue = efv.getValue();
if (Compare.equalsIgnoreCase(efv.getField().getName(), "body") ||
Compare.equalsIgnoreCase(efv.getField().getName(), "attachments"))
continue; // we handle this later
EmailField.SearchMethod searchMethod = efv.getField().getSearchMethod();
if (searchMethod==EmailField.SearchMethod.STORED)
doc.add(new Field(efv.getField().getIndexKey(),efv.getValue(),Field.Store.YES,Field.Index.UN_TOKENIZED));
else if (searchMethod==EmailField.SearchMethod.TOKENIZED)
doc.add(new Field(efv.getField().getIndexKey(),efv.getValue(),Field.Store.NO,Field.Index.TOKENIZED));
else if (searchMethod==EmailField.SearchMethod.TOKENIZED_AND_STORED) {
doc.add(new Field(efv.getField().getIndexKey()+"s",efv.getValue(),Field.Store.YES,Field.Index.UN_TOKENIZED));
doc.add(new Field(efv.getField().getIndexKey(),efv.getValue(),Field.Store.NO,Field.Index.TOKENIZED));
}
}
Config config = ConfigurationService.getConfig();
if (config.getIndexMessageBody()) {