コード例 #1
0
 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);
   }
 }
コード例 #2
0
 public void maybeRefresh() {
   try {
     if (fieldSearcherManager != null) {
       fieldSearcherManager.maybeRefresh();
     } else {
       fieldSearcherTaxonomyManager.maybeRefresh();
     }
   } catch (IOException ex) {
     throw new OpenEditException(ex);
   }
 }
コード例 #3
0
 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);
   }
 }