public void release(LuceneConnection inConnection) { try { if (inConnection.getSearcherAndTaxonomy() == null) { fieldSearcherManager.release(inConnection.getIndexSearcher()); } else { fieldSearcherTaxonomyManager.release(inConnection.getSearcherAndTaxonomy()); } } catch (IOException ex) { throw new OpenEditException(ex); } }
public void maybeRefresh() { try { if (fieldSearcherManager != null) { fieldSearcherManager.maybeRefresh(); } else { fieldSearcherTaxonomyManager.maybeRefresh(); } } catch (IOException ex) { throw new OpenEditException(ex); } }
public LuceneConnection acquire() { try { LuceneConnection connection = new LuceneConnection(); if (fieldSearcherManager != null) { IndexSearcher searcher = fieldSearcherManager.acquire(); connection.setIndexSearcher(searcher); } else { SearcherAndTaxonomy st = fieldSearcherTaxonomyManager.acquire(); connection.setSearcherAndTaxonomy(st); } return connection; } catch (IOException ex) { throw new OpenEditException(ex); } }