lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Puccianti <>
Subject Writing to indexes, transactional ?
Date Wed, 06 Feb 2002 02:47:37 GMT
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'
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



Do You Yahoo!? -- Une adresse gratuite et en fran├žais !
Yahoo! Mail :

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message