Mercurial Hosting > luan
comparison lucene/src/luan/modules/lucene/LuceneIndex.java @ 591:790d5de23042
add "strict" param to Io.repr();
add Lucene.index.ensure_open();
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 30 Aug 2015 11:37:39 -0600 |
parents | 60c549d43988 |
children | 50540f0813e2 |
comparison
equal
deleted
inserted
replaced
590:f050c30952c0 | 591:790d5de23042 |
---|---|
297 // call in finally block | 297 // call in finally block |
298 private static void close(IndexSearcher searcher) throws IOException { | 298 private static void close(IndexSearcher searcher) throws IOException { |
299 searcher.getIndexReader().decRef(); | 299 searcher.getIndexReader().decRef(); |
300 } | 300 } |
301 | 301 |
302 public void ensure_open() throws IOException { | |
303 close(openSearcher()); | |
304 } | |
305 | |
302 public int advanced_search( final LuanState luan, String queryStr, LuanFunction fn, Integer n, String sortStr ) throws LuanException, IOException, ParseException { | 306 public int advanced_search( final LuanState luan, String queryStr, LuanFunction fn, Integer n, String sortStr ) throws LuanException, IOException, ParseException { |
303 Utils.checkNotNull(luan,queryStr); | 307 Utils.checkNotNull(luan,queryStr); |
304 Query query = SaneQueryParser.parseQuery(mfp,queryStr); | 308 Query query = SaneQueryParser.parseQuery(mfp,queryStr); |
305 IndexSearcher searcher = threadLocalSearcher.get(); | 309 IndexSearcher searcher = threadLocalSearcher.get(); |
306 boolean inTransaction = searcher != null; | 310 boolean inTransaction = searcher != null; |