lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rob Outar" <rou...@ideorlando.org>
Subject java.lang.IllegalArgumentException: attempt to access a deleted document
Date Wed, 04 Jun 2003 16:07:32 GMT
Hi all,

	I have written a GUI program that looks for files on a given file system
that are not in the index and vice versa, files that are in the index but no
on the file system.  It is basically finds orphan files.  We do not want
files on the file system that are not in the index and documents in the
index that do not have a corresponding physical file on the file system.

	In the former case I get a list of all the files on the file system and
look in the index for the corresponding Document.  In the latter case I get
a list of all documents and then look for the files on the file system.
During this process I get the above exception.  Has anyone seen this before?
I am not sure how I am trying to access a deleted document, I think the
problem might be in the below code:

 public synchronized String[] getDocuments() throws IOException {

        IndexReader reader = null;
        try {
            reader = IndexReader.open(this.indexLocation);
            int numOfDocs      = reader.numDocs();
            String[] docs      = new String[numOfDocs];
            Document doc       = null;

            for (int i = 0; i < numOfDocs; i++) {
                doc = reader.document(i);
                docs[i] = doc.get(SearchEngineConstants.REPOSITORY_PATH);
            }
            return docs;
        }
        finally {
            if (reader != null) {
                reader.close();
            }
        }
    }

but I am not sure.

Any help would be appreciated.

Thanks,

Rob


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


Mime
View raw message