UndeleteAll() public method

Undeletes all documents currently marked as deleted in this index. since this reader was opened has this index open (write.lock could not be obtained)
public UndeleteAll ( ) : void
return void
        public virtual void  DoTestUndeleteAll()
        {
            sis.Read(dir);
            IndexReader reader = OpenReader();

            Assert.IsTrue(reader != null);
            Assert.AreEqual(2, reader.NumDocs());
            reader.DeleteDocument(0);
            Assert.AreEqual(1, reader.NumDocs());
            reader.UndeleteAll();
            Assert.AreEqual(2, reader.NumDocs());

            // Ensure undeleteAll survives commit/close/reopen:
            reader.Commit();
            reader.Close();

            if (reader is MultiReader)
            {
                // MultiReader does not "own" the directory so it does
                // not write the changes to sis on commit:
                sis.Commit(dir);
            }

            sis.Read(dir);
            reader = OpenReader();
            Assert.AreEqual(2, reader.NumDocs());

            reader.DeleteDocument(0);
            Assert.AreEqual(1, reader.NumDocs());
            reader.Commit();
            reader.Close();
            if (reader is MultiReader)
            {
                // MultiReader does not "own" the directory so it does
                // not write the changes to sis on commit:
                sis.Commit(dir);
            }
            sis.Read(dir);
            reader = OpenReader();
            Assert.AreEqual(1, reader.NumDocs());
        }
Example #2
0
 protected internal override void  DoUndeleteAll()
 {
     in_Renamed.UndeleteAll();
 }
Example #3
0
 protected internal override void  DoUndeleteAll(IState state)
 {
     in_Renamed.UndeleteAll(state);
 }