Hey Michael,
Are you writing this software for yourself or for reselling? We built
an email archiving service and we use lucene as our search engine. We
approach this a little differently.
BUT, i don't think it is wasteful to index the header information with
the attachment. Just don't store the fields.
-Michael
Michael Bell wrote:
We are writing a mail archiving program. Each piece of the message (eg each
attachment) is stored separately.
I'll try to keep this short and sweet :)
Currently we index the main header fields, like
subject
sender
recipients (space delimited)
etc.
This stuff is really only needed once per e-mail
We also index the attachment info:
attachment size (changed to a range like "large", "medium", etc)
attachment name
full text index
etc.
This stuff is needed to be distinct for each attachment in the e-mail
Our current algorithm is wasteful, but I see no better way to do it.
In a loop, for each attachment (and once if we have none), we add all the main
header stuff and the attachment stuff, as a separate Document per attachment.
This is wasteful, because the main header stuff is needlessly repeated.
Now, it would seem better and more efficient to have one Document for the whole
e-mail, storing the main header stuff only once, and storing the Attachment
stuff as multiple instances of the same field. Lucene supports this.
The problem is then a search on attachment stuff will return cross cartesian
results.
Example
if I have 2 attachments one named A.doc and one B.doc. And A.doc contains the full text
"turnip" and B.doc contains the text "dog".
Now if the user enters a search requesting email that contains Attachment name
A.Doc, and contents dog, the results will be
For the Per-Document storage:
no results found (correct I'd argue)
For the Single Document storage:
1 result found (because the full text and names of both are stored in the same
Document albeit different Field instances)
While tempted by the siren call of the Single Document method, it seems like this would
return unexpected results from the users point of view (although one could argue
otherwise, since holistically searching the e-mail as a whole it's returning the
"right" results.
What do you folks think? Any ideas for a better way to approach this?
Thanks
Mike
____________________________________________________________________________________Ready for the edge of your seat?
Check out tonight's top picks on Yahoo! TV.
http://tv.yahoo.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]