class LuceneSearchEngine {

    public List<String> searchForText(final String text) {
        List<String> fileNames = new ArrayList<>();
        getNewReaderAndSearcherUsingWriter();
        Query query = createQuery(text);
        try {
            TopDocs queryResult = doSearch(query);
            fileNames = getFileNames(queryResult);
            closeIndexReader();
        } catch (IOException e) {
            logger.error(" caught a " + e.getClass() + "\n with message: " + e.getMessage());
        }
        return fileNames;
    }

}