FAQ
I have two applications that share some of the same Lucene Indexes. I
recently upgrade the Lucene-core.jar from v2.0 to a nightly build (Feb.
04, 2006 - I was looking for the IndexWriter class that allows you to
merge indexes w/o optimizing).



Now I notice the index is a little different:



Prior to upgrading:

_0.cfs

deletable

segments



After upgrading:

_g.cfs

segments.gen

segments_17



Didn't think much of it until I started my test server and things
stopped working. I started debugging, and it seems like the
Lucene-core.jar (the version that was not built on Feb. 04, 2006) looks
at the new index and thinks that it does not exist... so it tries to
create a new index. It is successful at deleting the .cfs file, but not
the .gen and segments_17 (I'm assuming it doesn't recognize those types
of file).



Has anyone else run into this problem?

Search Discussions

  • Graham Stead at Feb 13, 2007 at 1:28 am
    I believe the Lucene file format changed in version 2.1, and your nightly
    .jar file is probably v2.1. See
    http://lucene.apache.org/java/docs/fileformats.html#Segments%20File.

    I'm afraid I'm not an expert on the related compatibility issues. It has
    been my experience that pre-2.1 Lucene cannot read 2.1 indexes (error: can't
    find segments file). You seem to have shown the converse is also
    true...although I could have sworn that Lucene 2.1 slurped my pre-2.1 index
    without problems.

    Hope this helps,
    -Graham



    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org
  • Chris Hostetter at Feb 13, 2007 at 1:40 am
    : I have two applications that share some of the same Lucene Indexes. I
    : recently upgrade the Lucene-core.jar from v2.0 to a nightly build (Feb.
    : 04, 2006 - I was looking for the IndexWriter class that allows you to
    : merge indexes w/o optimizing).

    Am I correct in understanding that you have two seperate applications: one
    reading hte index and one writing the index and you only upgraded lucene
    for the application that writes the index?

    If so, this is not a supported compatibility situation, if the wiki were
    up right now there is a document that explains...

    File formats are back-compatible between major versions. Version X.N
    should be able to read indexes generated by any version after and
    including version X-1.0, but may-or-may-not be able to read indexes
    generated by version X-2.N.

    ...what happens is that the 2.X code in the trunk can correctly read your
    2.1 index, but it modifies hte files on disk as you add documents to morph
    the index format to the new 2.X format -- your seperate 2.1 application
    can not read that format.

    (if i'm in correct and you actually updated the lucene jar for both
    applications then please clarify)


    -Hoss


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org
  • Van Nguyen at Feb 13, 2007 at 1:55 am

    Am I correct in understanding that you have two seperate applications: one
    reading hte index and one writing the index and you only upgraded lucene
    for the application that writes the index? Yes
    If so, this is not a supported compatibility situation, if the wiki were
    up right now there is a document that explains...
    DOH!

    Thanks,

    Van

    ---------------------------------------------------------------------
    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
  • Doron Cohen at Feb 13, 2007 at 1:41 am
    Hi,

    I suspect what happened is result of a "mis-ordered" upgrade sequence:
    The first of the two applications managed to access and upgrade
    the index. However the second application then tried to update the
    already upgraded index and messed things up.

    I think this may even be worse, as one of the changes since 2.0 is
    that write locks are now (by default) maintained in the index directory.
    So if the two applications attempt to access the index at the same time,
    but one uses 2.0 and the other uses "to-be-2.1" version, since locks
    are maintained in different places, they might both write to the index
    at the same time and corrupt it.

    A related discussion is in this thread:
    http://issues.apache.org/jira/browse/LUCENE-771#action_12464409

    To conclude, the upgrade steps should be:
    1) upgrade all readers.
    2) upgrade all writers at once (no old writer should access the
    index ones this step started).

    Regards,
    Doron

    "Van Nguyen" <vnguyen@ur.com> wrote on 12/02/2007 16:55:59:
    I have two applications that share some of the same Lucene Indexes. I
    recently upgrade the Lucene-core.jar from v2.0 to a nightly build (Feb.
    04, 2006 - I was looking for the IndexWriter class that allows you to
    merge indexes w/o optimizing).



    Now I notice the index is a little different:



    Prior to upgrading:

    _0.cfs

    deletable

    segments



    After upgrading:

    _g.cfs

    segments.gen

    segments_17



    Didn't think much of it until I started my test server and things
    stopped working. I started debugging, and it seems like the
    Lucene-core.jar (the version that was not built on Feb. 04, 2006) looks
    at the new index and thinks that it does not exist... so it tries to
    create a new index. It is successful at deleting the .cfs file, but not
    the .gen and segments_17 (I'm assuming it doesn't recognize those types
    of file).



    Has anyone else run into this problem?

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupjava-user @
categorieslucene
postedFeb 13, '07 at 12:56a
activeFeb 13, '07 at 1:55a
posts5
users4
websitelucene.apache.org

People

Translate

site design / logo © 2022 Grokbase