424425426427428429430431432433434
} return list; } finally { if (ia != null && indexSearcher != null) { ia.release(indexSearcher); } } } /**
484485486487488489490491492493494
try { writer.deleteAll(); this.spellIndex.createReopenFile(); } finally { if (accessor != null && writer != null) { accessor.release(writer); } } } /**
504505506507508509510511512513514
final IndexSearcher indexSearcher = (IndexSearcher) accessor.getPrioritizedSearcher(); try { return indexSearcher.docFreq(F_WORD_TERM.createTerm(word)) > 0; } finally { if (accessor != null && indexSearcher != null) { accessor.release(indexSearcher); } } } /**
558559560561562563564565566567568
// optimize the writer if (obj_count > 0) { writer.optimize(); this.spellIndex.createReopenFile(); } accessor.release(writer); accessor.release(indexSearcher); } } }
559560561562563564565566567568569
if (obj_count > 0) { writer.optimize(); this.spellIndex.createReopenFile(); } accessor.release(writer); accessor.release(indexSearcher); } } } /**
466467468469470471472473474475476
if (taxonomyAccessor != null && taxonomyWriter != null) { taxonomyAccessor.release(taxonomyWriter); } if (indexAccessor != null && indexWriter != null) { indexAccessor.release(indexWriter); } if (indexAccessor != null && indexReader != null) { indexAccessor.release(indexReader, false); }
469470471472473474475476477478479
if (indexAccessor != null && indexWriter != null) { indexAccessor.release(indexWriter); } if (indexAccessor != null && indexReader != null) { indexAccessor.release(indexReader, false); } if (objectCount > 0) { indexLocation.createReopenFile(); }
3233343536373839404142
writer = ia.getWriter(); writer.optimize(); } catch (IOException e) { log.error("Optimize index.", e); } finally { ia.release(writer); } log.debug("Finished optimizing index."); } else { log.error("Index does not seem to be a Lucene index. Therfore no " + "optimizing will be done."); }
6465666768697071727374
LuceneDictionary dict = new LuceneDictionary(sourceReader, fieldname); spellchecker.indexDictionary(dict); } } finally { if (sourceAccessor != null && sourceReader != null) { sourceAccessor.release(sourceReader, false); } } log.debug("Finished reindexing didyoumean index."); ucReIndex.stop(); }
365366367368369370371372373374375
processDocuments(docs, result, reader, parsedQuery); } catch (IOException e) { LOGGER.error("Cannot get Index reader for highlighting", e); } finally { indexAccessor.release(reader, false); } ucProcessSearchResolvables.stop(); return result; }