lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erick Erickson <>
Subject Re: how to design Lucene Document and Field to indexing and searching email message and attachments
Date Wed, 28 Apr 2010 15:00:48 GMT
This problem has been discussed several times, although I can't
remember the answer. So I'd recommend searching the mail archive

Lucid maintains a searchable archive, see:


On Wed, Apr 28, 2010 at 2:35 AM, 刘庆志 <> wrote:

> hi all:
> our bussiness system generate some data,that information structrue like
> email message,one message have some attachments,so we can use email message
> to think of our data,I need index and search the message and its
> attachments,and when display hits,must display two kinds of links for every
> hit: one kind for message,and the other for attachments which match the
> query criteria,so the former kind there is only one link,but latter may be
> zero to n links.
> one design may be as:for every message design one Lucene Document,it has a
> field to record its id,let's name the field id,an other field to correspond
> all its attachments,let's name the field attachments,afert that we also
> design a Lucene Document to correspond every message's every attachment,this
> Document has a field record its message's id,let's name the field messageid,
> so when query,we can retrieval messages may be itself's cotent or its
> attachments content match the query criteria,for generating links for
> attachments which match the query criteria,we can requey again,this time we
> can query only the message's attachments by adding a query condition that
> messageid=father query's messge's obviously,there are two
> disadvantages: 1,it indexes attachments twice,one in message,and the other
> in Lucene Document for attachment.2,user's one query becomes 1+n query,1 for
> query message and its all attachments,n for requery the message's every
> there any better solution?
> dazhi
> Thanks for any hints!!!

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message