Why do I sometimes get a FileNotFoundException when I search and update my index at the same time?
This typically happens when people do one or more of the following things: • Disable the locking on one or more of the processes searching or updating the index. • Configure a different lockDir for at least one of the processes searching or updating the index. • Try to search or update an index with the lockDir configured to be on an NFS (or Samba) mounted filesystem. Even though index searching is a read only operation, the IndexSearcher must momentarily lock the index when it is opened in order to get the list of files in the index. If locking is not configured properly it gets an incorrect list (because the list of files changes as the IndexWriter adds docs or optimizes the index). Remote filesystems (like NFS and Samba) rarely work, because they cannot make the transactional guarantees neccessary to ensure that all clients get consistent views of the directory.