class LuceneService {

    public List<Document> search(Query query, boolean prefixWildCard) {
        List<Document> documents = new ArrayList<Document>();
        try {
            IndexSearcher searcher = getSearcher();
            TopDocs search = searcher.search(query, 10000);
            for (ScoreDoc scoreDoc : search.scoreDocs) {
                Document doc = searcher.doc(scoreDoc.doc);
                documents.add(doc);
            }
        } catch (Exception e) {
            e.printStackTrace();
            throw new RuntimeException(e);
        }
        return documents;
    }

    public  LuceneService();
      LuceneService(Directory directory);

}