lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tanya Levshina" <ta...@volvovski.com>
Subject RE: Problem using RAMDirectory as a buffer
Date Fri, 22 Jun 2007 00:04:27 GMT

Nope, doesn't work.
I've tried:
....
ramWriter.addDocument(doc);
ramWriter.flush();
ramWriter.close();
fsWriter.addIndexes(new Directory[] {ramDir,});
....


Any other suggestions?

Thanks,
Tanya
PS As I said this is just a trivial test I created because it didn't work
for more complicated problem

-----Original Message-----
From: Michael Busch [mailto:buschmic@gmail.com] 
Sent: Thursday, June 21, 2007 6:57 PM
To: java-user@lucene.apache.org
Subject: Re: Problem using RAMDirectory as a buffer

Daniel Noll wrote:
> On Friday 22 June 2007 09:34:44 Tanya Levshina wrote:
>>          ramWriter.addDocument(doc);
>>
>>          fsWriter.addIndexes(new Directory[] {ramDir,});
> 
> As IndexWriter already does this internally, I'm not exactly sure why
you're 
> trying to implement it again on the outside.
> 
> Daniel
> 

You should close or flush the ramWriter before you add the ramDir to the
fsWriter, otherwise the docs won't get flushed to the ramDir.

But I share Daniel's opinion. IndexWriter has it's own buffer internally.

- Michael


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





---------------------------------------------------------------------
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