Hey Eric, I think you want:
fsWriter.addIndexes(Directory[] {ramDir}); to be: fsWriter.addIndexes(new Directory[]{ramDir}); JAMES --- zheng <[EMAIL PROTECTED]> wrote: > I am a novice in lucene. I write some code to do > batch indexing using > RAMDirectory according to the code provided in > lucene in action, which is > something like FSDirectory fsDir = > FSDirectory.getDirectory("/tmp/index", > > true); > > RAMDirectory ramDir = new RAMDirectory(); > > IndexWriter fsWriter = IndexWriter(fsDir, > > new SimpleAnalyzer(), true); > > IndexWriter ramWriter = new IndexWriter(ramDir, > > new SimpleAnalyzer(), true); > > while (there are documents to index) { > > ... create Document ... > > ramWriter.addDocument(doc); > > if (condition for flushing memory to disk has been > met) { > > fsWriter.addIndexes(Directory[] {ramDir}); > > ramWriter.close(); > > ramWriter = new IndexWriter(ramDir, new > SimpleAnalyzer(), > > true); > > } > > } > > But it cannot compile correctly on > fsWriter.addIndexes(Directory[] > {ramDir}); It seems some problem with ramDir. Is > there something changed at > lucene 2.0? How can I implement batch indexing > correctly? Any simple code. > > Thanks! > > > > Eric > > > > > > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]