lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grant Ingersoll <>
Subject Re: indexing api wrt Analyzer
Date Thu, 13 Mar 2008 18:35:21 GMT

On Mar 13, 2008, at 11:03 AM, John Wang wrote:

> Yes, but usually it's a good idea to add documents in batch and not  
> having
> to reinstantiate the writer for every document and then closing it.

Why does what I suggested require instantiating a new writer for every  
document?  It uses the analyzer you pass in w/ the method:

IndexWriter writer = new IndexWriter(dir, defaultAnalyzer,....)

while adding docs
    Document doc = ...
    Analyzer analyzer = getAnalyzer(language)
    writer.addDocument(doc, analyzer)



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

View raw message