Refactored Lucene-handling a bit to ensure less locks etc