lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grant Ingersoll <gsing...@apache.org>
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)

writer.close()

-Grant


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


Mime
View raw message