Refactored lucene index access.