/** * Constructor. * * @param luceneIndexPath Path to the lucene index files * @param maxResults Maximum number of allowed results in a page * @param searchTimeout Maximum time in milliseconds that a lucene search can run */ public LuceneSearchProvider(String luceneIndexPath, int maxResults, int searchTimeout) { this.luceneIndexPath = luceneIndexPath; Utils.createParentDirectories(this.luceneIndexPath); this.maxResults = maxResults; this.searchTimeout = searchTimeout; try { luceneDirectory = new MMapDirectory(Paths.get(this.luceneIndexPath)); luceneIndexIsHealthy = true; } catch (IOException e) { luceneIndexIsHealthy = false; String message = ErrorMessageFormat.UNABLE_TO_CREATE_DIR.format(this.luceneIndexPath); LOG.error(message, e); } }