lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christophe <>
Subject Re: Using Lucene for searching tokens, not storing them.
Date Fri, 14 Apr 2006 16:01:08 GMT
On 14 Apr 2006, at 08:55, karl wettin wrote:

> I don't want to use Lucene for persistence. I do not want to store  
> tokens nor field text in a FSDirectory or in a RAMDirectory. I want  
> to take store the the tokens in my application.

If I understand your question, I think that the first answer was  
exactly correct.

You don't need to use Lucene for persistence in order to use it for  
searching.  By setting the fields to be non-stored, Lucene only  
constructs the index for those fields, and doesn't save the full text  
of the field.  For example, we store the text we are searching in an  
RDBMS, and only use Lucene for the full-text index.  When we need to  
retrieve the actual document, we don't go to Lucene; we go to the RDBMS.

This doesn't require any code changes at all; you just set the fields  
to non-stored when you index the documents.

Lucene still does need an index, somewhere, in order to search, and  
Lucene manages the format of the index, so you will still need to use  
IndexWriter and IndexReader, and some Directory subclass, in order  
for Lucene to have a place to store its index.  You can create a new  
flavor of Directory if you want Lucene to store its index files  
somewhere more exotic than the standard classes allow.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message