Josh Joy wrote:

I was implementing some calls to Lucene, though was
curious if there was some documentation I was missing that indicated why a method throws an exception.

Example, IndexReader - deleteDocuments() - what is the
root cause as to why it throws IOException?

I'm trying to utilize this info to determine my
exception handling strategy for all my Lucene API calls (should I fail,
retry, ignore, etc)

I agree we don't have enough documentation around why an IOException
might be thrown for the various Lucene methods.

For your example (IndexReader.deleteDocuments) there are some
"interesting" cases that I think we should call out:

  * Another "writer" (IndexWriter or IndexReader with pending deletes)
    is already open against the index (this will be the "Lock obtain
    timed out" IOException).

  * The reader is "stale" meaning another writer has committed changes
    to the index since this reader was opened.

Then of course index corruption, transient IO problems, permission
problems, etc, can lead to IOExceptions.

I will open a JIRA issue.

Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to