Examples of deleteDocuments()


Examples of org.springmodules.lucene.index.core.DefaultLuceneIndexTemplate.deleteDocuments()

      document.add(new Field("id", "3", Field.Store.YES, Field.Index.UN_TOKENIZED));
      template.addDocument(document);
      template.addDocument(document);
      template.addDocument(document);
      try {
        template.deleteDocuments(new Term("id", "1"));
      } catch(LuceneIndexingException ex) {}
      template.optimize();
    } finally {
      resourceManager.releaseResources();
    }
View Full Code Here

Examples of org.springmodules.lucene.index.factory.LuceneIndexReader.deleteDocuments()

      indexReader.deleteDocument(2);
      fail();
    } catch(LuceneIndexingException ex) {}

    try {
      indexReader.deleteDocuments(new Term("id", "1"));
      fail();
    } catch(LuceneIndexingException ex) {}

    try {
      indexReader.setNorm(2, null, 2);
View Full Code Here

Examples of org.springmodules.lucene.index.factory.LuceneIndexReader.deleteDocuments()

    LuceneIndexReader indexReader = (LuceneIndexReader)indexReaderControl.getMock();

    indexFactory.getIndexReader();
    indexFactoryControl.setReturnValue(indexReader, 1);
   
    indexReader.deleteDocuments(new Term("field","lucene"));
    indexReaderControl.setReturnValue(1, 1);
   
    indexReader.close();
    indexReaderControl.setVoidCallable(1);
   
View Full Code Here

Examples of org.springmodules.lucene.index.factory.LuceneIndexReader.deleteDocuments()

    indexReaderControl.setVoidCallable(1);

    indexFactory.getIndexReader();
    indexFactoryControl.setReturnValue(indexReader, 1);
   
    indexReader.deleteDocuments(term);
    indexReaderControl.setReturnValue(1, 1);
   
    indexReader.close();
    indexReaderControl.setVoidCallable(1);
   
View Full Code Here

Examples of org.springmodules.lucene.index.factory.LuceneIndexReader.deleteDocuments()

    indexReaderControl.setVoidCallable(1);

    indexFactory.getIndexReader();
    indexFactoryControl.setReturnValue(indexReader, 1);
   
    indexReader.deleteDocuments(term);
    indexReaderControl.setReturnValue(1, 1);
   
    indexReader.close();
    indexReaderControl.setVoidCallable(1);
   
View Full Code Here

Examples of org.springmodules.lucene.index.factory.LuceneIndexReader.deleteDocuments()

  public void deleteDocuments(Term term) {
    System.out.println("> indexFactory = "+indexFactory);
    LuceneIndexReader reader = IndexReaderFactoryUtils.getIndexReader(indexFactory);
    System.out.println("> reader = "+reader);
    try {
      reader.deleteDocuments(term);
    } catch(IOException ex) {
      throw new LuceneIndexAccessException("Error during deleting a document.",ex);
    } finally {
      IndexReaderFactoryUtils.releaseIndexReader(indexFactory,reader);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.