Package org.springmodules.lucene.index

Examples of org.springmodules.lucene.index.LuceneIndexAccessException


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


   */
  public static void releaseIndexReader(IndexFactory indexFactory,IndexReader indexReader) {
    try {
      doReleaseIndexReader(indexFactory,indexReader);
    } catch(IOException ex) {
      throw new LuceneIndexAccessException("Unable to close index reader",ex);
    }
  }
View Full Code Here

  public void deleteDocument(int internalDocumentId) {
    IndexReader reader=IndexReaderFactoryUtils.getIndexReader(indexFactory);
    try {
      reader.delete(internalDocumentId);
    } catch(IOException ex) {
      throw new LuceneIndexAccessException("Error during deleting a document.",ex);
    } finally {
      IndexReaderFactoryUtils.releaseIndexReader(indexFactory,reader);
    }
  }
View Full Code Here

  public void deleteDocuments(Term term) {
    IndexReader reader=IndexReaderFactoryUtils.getIndexReader(indexFactory);
    try {
      reader.delete(term);
    } catch(IOException ex) {
      throw new LuceneIndexAccessException("Error during deleting a document.",ex);
    } finally {
      IndexReaderFactoryUtils.releaseIndexReader(indexFactory,reader);
    }
  }
View Full Code Here

  public void undeleteDocuments() {
    IndexReader reader=IndexReaderFactoryUtils.getIndexReader(indexFactory);
    try {
      reader.undeleteAll();
    } catch(IOException ex) {
      throw new LuceneIndexAccessException("Error during undeleting all documents.",ex);
    } finally {
      IndexReaderFactoryUtils.releaseIndexReader(indexFactory,reader);
    }
  }
View Full Code Here

  protected Document createDocument(DocumentCreator documentCreator) {
    try {
      return documentCreator.createDocument();
    } catch (IOException ex) {
      throw new LuceneIndexAccessException("Construction of the desired Document failed", ex);
    }
  }
View Full Code Here

  protected List createDocuments(DocumentsCreator documentsCreator) {
    try {
      return documentsCreator.createDocuments();
    } catch (IOException ex) {
      throw new LuceneIndexAccessException("Construction of the desired Document failed", ex);
    }
  }
View Full Code Here

  public void addDocument(Document document,Analyzer analyzer) {
    IndexWriter writer=IndexWriterFactoryUtils.getIndexWriter(indexFactory);
    try {
      doAddDocument(writer,document,null);
    } catch(IOException ex) {
      throw new LuceneIndexAccessException("Error during adding a document.",ex);
    } finally {
      IndexWriterFactoryUtils.releaseIndexWriter(indexFactory,writer);
    }
  }
View Full Code Here

      for(Iterator i=documents.iterator();i.hasNext();) {
        Document document=(Document)i.next();
        doAddDocument(writer,document,analyzer);
      }
    } catch(IOException ex) {
      throw new LuceneIndexAccessException("Error during adding a document.",ex);
    } finally {
      IndexWriterFactoryUtils.releaseIndexWriter(indexFactory,writer);
    }
  }
View Full Code Here

        writer.addDocument(document,getAnalyzer());
      } else {
        writer.addDocument(document);
      }
    } else {
      throw new LuceneIndexAccessException("The document created is null.");
    }
  }
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.