lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Halácsy Péter <halacsy.pe...@axelero.com>
Subject RE: batch indexing
Date Wed, 07 Aug 2002 11:48:52 GMT


> -----Original Message-----
> From: Doug Cutting [mailto:cutting@lucene.com]
> Sent: Tuesday, August 06, 2002 11:36 PM
> To: Lucene Users List
> Subject: Re: batch indexing
> 
> 
> Halácsy Péter wrote:
> > Unfortunatly one has to modify lucene code to use it: add 
> two methods to IndexWriter.java
> >   public synchronized void setAnalyzer(Analyzer a) {
> >       this.analyzer = a;
> >   }
> >   public synchronized Analyzer getAnalyzer() {
> >       return analyzer;
> >   }
> 
> I can see the case for getAnalyzer(), but setAnalyzer() could 
> be dangerous.
> 
> In any case, all that you invoke in your code is getAnalyzer(), and, 
> actually, you could use null instead where you call it, since 
> the only 
> IndexWriter method that uses the analyzer is addDocument, and 
> you never 
> invoke addDocument() on "realWriter".

I think I have to use an analyzer to add document to the ram, haven't I? 
Do you mean that I can write
 m_ramWriter = new IndexWriter(m_ramDirectory, null, true);

instead of

m_ramWriter = new IndexWriter(m_ramDirectory, m_realWriter.getAnalyzer(), true); ?

peter




> 
> So no change to IndexWriter is required, but I would also not 
> object to 
> the addition of a getAnalyzer() method, especially if someone 
> can come 
> up with a use for it!
> 
> Doug
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:lucene-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: 
> <mailto:lucene-user-help@jakarta.apache.org>
> 
> 

--
To unsubscribe, e-mail:   <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>


Mime
View raw message