On Mon, May 19, 2014 at 4:59 AM, Clemens Wyss DEV <clemens...@mysign.ch> wrote:
>> Are you using doc-values updates?
> Not to my knowledge, i.e. not explicitly

Hmm ok.

>> Are you ever removing files directly from the index directory yourself 
>> between reopens?
> Yes. Reindexing an index completely(*) is done in a separate temporary 
> index/folder. After that we (guarded by a mutex) swap the files, i.e. delete 
> the old ones and then move over the new index files.
>
> (*)we do this for example after a massimport of index-relevant data (instead 
> of updating each and every element on ist own).

Hmm, but you swap these files over while an IndexReader is still open
on the index?  And then you call openIfChanged?

If so, that's what's leading to this exception: you shouldn't ever
need to overwrite files at index level.

Instead, use IndexWriter.deleteAll, then index all your new docs, then
commit, then reopen the reader.  Alternatively, open IndexWriter with
OpenMode.CREATE on the index, index all your docs, commit, and reopen.

Separately, it's better to use a near-real-time IndexReader so you
don't have to commit in order to see changes.

Mike McCandless

http://blog.mikemccandless.com

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

Reply via email to