open the searcher so that the searcher's close() call will close the implicitly opened reader

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150653 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Daniel Naber 2004-11-19 20:58:45 +00:00
parent 0d3df6128f
commit f9f3f74b68
1 changed files with 1 additions and 2 deletions

View File

@ -42,8 +42,7 @@ public String escapeHTML(String s) {
//less
try {
searcher = new IndexSearcher(
IndexReader.open(indexName)); //create an indexSearcher for our page
searcher = new IndexSearcher(indexName); //create an indexSearcher for our page
//NOTE: this operation is slow for large
//indices (much slower than the search itself)
//so you might want to keep an IndexSearcher