This, question must have been discussed several times
before, but I could not find the answer I was looking
for in the mailing list archive...

I was wondering if Lucene writing process was 'fully'
transactional.
As far as I understand, it is supposed to be
transactional, as a new segment is referenced in the
segments file only when it has been totally written.
So, if you kill your application while writing or
optimizing to the index, you endup getting some
segments files on the disk that are not referenced in
the 'segments' file, and that are just left in the
index directory without being used.
My concern is : if you write again to the index, the
indexwriter might write onto the same segment name.
But if I am right, FSDirectory.createFile() does not
erase the file if it already exists : it opens a
RandomAccessFile in read/write mode, which opens the
file when it already exists and does not overwrite.
In that case, you endup appending data to an existing
segment file calling RandomAccessFile.write(byte[]
b,int off,int len) instead of writing the segment from
scratch, and thus corrupting the index... maybe ?

I hope this makes sense...
I might be totally wrong, but I would be interested to
know...

Thanks,

Sylvain

___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.fr

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to