searcher = new IndexSearcher(directory, true);
}
Results result = new Results();
QueryParser qp = new QueryParser(Version.LUCENE_36, "paragraph", new StandardAnalyzer(Version.LUCENE_36));
Query query = qp.parse(queryStr);
TopDocs topDocs = searcher.search(query, 20);
System.out.println("Found " + topDocs.totalHits + " total hits.");
for (int i = 0; i < topDocs.scoreDocs.length; i++) {
Document theDoc = searcher.doc(topDocs.scoreDocs[i].doc);
result.matches.add(theDoc);
}