You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Anand Kishore <an...@gmail.com> on 2005/09/23 13:40:22 UTC

Displaying search context

Hi,

I am indexing emails through Lucene. The body of the mails is stored in an
''Unstored" field. I also have a search interface setup which returns me all
Documents matching my query. What i need is to display a few lines from the
body of the mails where the queryTerm was found. How can this be achieved as
the body is just indexed but not stored.

Thanx

- Andy
http://da-tek-ee.blogspot.com

Re: Displaying search context

Posted by Karl Øie <ka...@gan.no>.
You can´t. If the indexing is unstored only the indicies of the words 
are indexed and you cannot reconstruct the text from the field.

Karl

On 23. sep. 2005, at 13.40, Anand Kishore wrote:

> Hi,
>
> I am indexing emails through Lucene. The body of the mails is stored 
> in an
> ''Unstored" field. I also have a search interface setup which returns 
> me all
> Documents matching my query. What i need is to display a few lines 
> from the
> body of the mails where the queryTerm was found. How can this be 
> achieved as
> the body is just indexed but not stored.
>
> Thanx
>
> - Andy
> http://da-tek-ee.blogspot.com
>
- All of Canada sincerely apologizes for Celine Dion. In their defense; 
she's French.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Displaying search context

Posted by Anand Kishore <an...@gmail.com>.
Thanx guyz for your prompt replies.

>>When you want to display relevant text for a search
>>result, find the file on disk, and pass it through the Lucene
>>Highlighter (see the Lucene sandbox).

A nice suggestion but again as i'm indexing mails my Lucene Document has
fields like "Sender", "Subject", and "Content". Feeding the entire mail from
disk will also include meta-data which i need to exclude.

OR

If i extract the subject, content etc concating them as a string, and then
feed it to the highlighter it should work rite???

--
- Andy

Re: Displaying search context

Posted by Dan Funk <fu...@BATTELLE.ORG>.
What you are doing is a good, scalable practice.  You need to store 
those email messages somewhere outside of Lucene, and use a unique id to 
correlate the two.  When you want to display relevant text for a search 
result, find the file on disk, and pass it through the Lucene 
Highlighter  (see the Lucene sandbox).  This will give you what you are 
looking for, and it will scale well in the future.

Anand Kishore wrote:

>Hi,
>
>I am indexing emails through Lucene. The body of the mails is stored in an
>''Unstored" field. I also have a search interface setup which returns me all
>Documents matching my query. What i need is to display a few lines from the
>body of the mails where the queryTerm was found. How can this be achieved as
>the body is just indexed but not stored.
>
>Thanx
>
>- Andy
>http://da-tek-ee.blogspot.com
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org