You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by Apache Wiki <wi...@apache.org> on 2009/05/21 06:33:53 UTC
[Solr Wiki] Update of "MailEntityProcessor" by PreetamRao
Dear Wiki user,
You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.
The following page has been changed by PreetamRao:
http://wiki.apache.org/solr/MailEntityProcessor
------------------------------------------------------------------------------
- PlaceHolder for MailEntityProcessor .
+ == Where it is used ==
+ This is used for indexing mails from a mail box. Currently IMAP protocol is supported. Since Java Mail API is used, it should be able to support other protocols as well in future.
+
+ == What will the indexed document contain ==
+
+ Every mail gets index as one document. The schema will be:
+ {{{
+ // single valued
+ private static final String MESSAGE_ID = "messageId";
+ private static final String SUBJECT = "subject";
+ private static final String FROM = "from";
+ private static final String SENT_DATE = "sentDate";
+ private static final String XMAILER = "xMailer";
+ // multi valued
+ private static final String TO_CC_BCC = "allTo";
+ private static final String FLAGS = "flags";
+ private static final String CONTENT = "content";
+ private static final String ATTACHMENT = "attachment";
+ private static final String ATTACHMENT_NAMES = "attachmentNames";
+ // flag values
+ private static final String FLAG_ANSWERED = "answered";
+ private static final String FLAG_DELETED = "deleted";
+ private static final String FLAG_DRAFT = "draft";
+ private static final String FLAG_FLAGGED = "flagged";
+ private static final String FLAG_RECENT = "recent";
+ private static final String FLAG_SEEN = "seen";
+ }}}
+
+ == How to configure ==
+
+ The data-config.xml should have the below configuration at a minimum.
+
+ {{{
+ <document>
+ <entity processor="MailEntityProcessor"
+ user="somebody@gmail.com"
+ password="something"
+ host="imap.gmail.com"
+ protocol="imaps"
+ folders = "x,y,z"/>
+ </document>
+ }}}
+
+ == Additional configuration ==
+
+ The below attributes help fine tune the indexing.
+ These are all optional.
+
+ === folders to index ===
+
+ * '''recurse''' : Index the sub folders recursively.
+ * '''include''' : comma separated list of regex patterns to include
+ * '''exclude''' : comma separated list of regex patterns to exclude
+
+ === timeouts ===
+
+ * '''connectTimeout''' : maximum time to wait in milliseconds while connecting. Default is 30 seconds.
+ * '''readTimeout''' : maximum time to wait in milliseconds while fetching mails from mail server. Default is 60 seconds.
+
+ === handling attachments ===
+
+ * '''processAttachement''' : If true, the attachments are also indexed. They can be retrieved or searched using "attachment" and ""attachmentNames" multi valued fields in the indexed documents.
+ The MailEntityProcessor uses Apache Tika.
+
+ === fetching mails since a certian date ==
+
+ * '''fetcchmailsSince''' : This should be in the format "yyyy-MM-dd HH:mm:ss"
+
+ === custom filter for fetching mails ===
+
+ * '''customFilter''' : Should implement the below interface, where SearchTerm and Folder are from Java Mail API.
+
+ {{{
+ public static interface CustomFilter {
+ public SearchTerm getCustomSearch(Folder folder);
+ }
+ }}}
+
+ === Other indexing efficiency attributes ===
+
+ * '''batchSize''' : How many mails to fetch at a time. Default is 20.
+ * '''fetchSize''' : Sets the "mail.imap.fetchsize" property. Default is 32KB.
+