Package org.springmodules.lucene.index

Examples of org.springmodules.lucene.index.LuceneIndexAccessException


   */
  public static void releaseSearcher(SearcherFactory searcherFactory,Searcher searcher) {
    try {
      doReleaseSearcher(searcherFactory,searcher);
    } catch(IOException ex) {
      throw new LuceneIndexAccessException("Unable to close index searcher",ex);
    }
  }
View Full Code Here


        return;
      }

      searcher.close();
    } catch(IOException ex) {
      throw new LuceneIndexAccessException("Unable to close index searcher",ex);
    }
  }
View Full Code Here

      if( optimizeIndex ) {
        writer.optimize();
      }
    } catch(IOException ex) {
      logger.error("Error during indexing the datasource",ex);
      throw new LuceneIndexAccessException("Error during indexing the datasource",ex);
    } finally {
      IndexWriterFactoryUtils.releaseIndexWriter(getIndexFactory(),writer);
    }
  }
View Full Code Here

      if( optimizeIndex ) {
        writer.optimize();
      }
    } catch(IOException ex) {
      logger.error("Error during indexing the directory : "+dirToParse,ex);
      throw new LuceneIndexAccessException("Error during indexing the directory : "+dirToParse,ex);
    } finally {
      IndexWriterFactoryUtils.releaseIndexWriter(getIndexFactory(),writer);
    }
  }
View Full Code Here

   */
  public static IndexWriter getIndexWriter(IndexFactory indexFactory) {
    try {
      return doGetIndexWriter(indexFactory);
    } catch (IOException ex) {
      throw new LuceneIndexAccessException("Could not get Lucene reader", ex);
    }
  }
View Full Code Here

   */
  public static void releaseIndexWriter(IndexFactory indexFactory,IndexWriter indexWriter) {
    try {
      doReleaseIndexWriter(indexFactory,indexWriter);
    } catch(IOException ex) {
      throw new LuceneIndexAccessException("Unable to close index writer",ex);
    }
  }
View Full Code Here

   * Check if the directory is specified for the factory. If not, the
   * method will throw a LuceneIndexAccessException exception
   */
  private void checkDirectory() {
    if( getDirectory()==null ) {
      throw new LuceneIndexAccessException("The directory is not specified");
    }
  }
View Full Code Here

    boolean locked = IndexReader.isLocked(getDirectory());
    if( locked ) {
      if( resolveLock ) {
        IndexReader.unlock(getDirectory());
      } else {
        throw new LuceneIndexAccessException("The index is locked");
      }
    }
  }
View Full Code Here

      boolean exist = IndexReader.indexExists(getDirectory());
      if( exist ) {
        return IndexReader.open(getDirectory());
      } else {
        throw new LuceneIndexAccessException("The index doesn't exist for the specified directory");
      }
    } catch(IOException ex) {
      throw new LuceneIndexAccessException("Error during opening the reader",ex);
    }
  }
View Full Code Here

      boolean create = !IndexReader.indexExists(getDirectory());
      IndexWriter writer = new IndexWriter(getDirectory(),getAnalyzer(),create);
      setIndexWriterParameters(writer);
      return writer;
    } catch(IOException ex) {
      throw new LuceneIndexAccessException("Error during creating the writer",ex);
    }
  }
View Full Code Here

TOP

Related Classes of org.springmodules.lucene.index.LuceneIndexAccessException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.