Vladimir Kuzmin created LUCENE-6765:
---------------------------------------

             Summary: CheckIndex.checkIndex throws IndexNotFoundException: no 
segments* file found in RAMDirectory@
                 Key: LUCENE-6765
                 URL: https://issues.apache.org/jira/browse/LUCENE-6765
             Project: Lucene - Core
          Issue Type: Bug
          Components: core/index
    Affects Versions: 5.2.1
         Environment: OS X, Lucene 5.2.1
            Reporter: Vladimir Kuzmin
            Priority: Minor


I am testing upgrade from Lucene 4.1 to 5.2.1 and found that behavior of 
CheckIndex.checkIndex() changed. We used the following to create status for 
empty dir (we use it for some reporting purpose):

CheckIndex.Status status = new CheckIndex(new RAMDirectory()).checkIndex(); 

At 5.2.1 it throws:

org.apache.lucene.index.IndexNotFoundException: no segments* file found in 
RAMDirectory@51f090da 
lockFactory=org.apache.lucene.store.SingleInstanceLockFactory@8b6023d: files: []
        at org.apache.lucene.index.CheckIndex.checkIndex(CheckIndex.java:487)
        at org.apache.lucene.index.CheckIndex.checkIndex(CheckIndex.java:466)

I expect that it should returns status with cantOpenSegments flag on. 
https://lucene.apache.org/core/5_2_1/core/org/apache/lucene/index/CheckIndex.Status.html#cantOpenSegments

Is it expected behavior?

If this isn't expected, I am willing to provide a fix (should be minor) that I 
could figure out on it how to contribute.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to