return SearchQuery.headerDateBefore(ImapConstants.RFC822_DATE, date.toDate(), DateResolution.Day);
case SearchKey.TYPE_SENTON:
return SearchQuery.headerDateOn(ImapConstants.RFC822_DATE, date.toDate(), DateResolution.Day);
case SearchKey.TYPE_SENTSINCE:
// Include the date which is used as search param. See IMAP-293
Criterion onCrit = SearchQuery.headerDateOn(ImapConstants.RFC822_DATE, date.toDate(), DateResolution.Day);
Criterion afterCrit = SearchQuery.headerDateAfter(ImapConstants.RFC822_DATE, date.toDate(), DateResolution.Day);
return SearchQuery.or(onCrit, afterCrit);
case SearchKey.TYPE_SEQUENCE_SET:
return sequence(key.getSequenceNumbers(), session, true);
case SearchKey.TYPE_SINCE: