lucene/lucene-directory/src/test/java/org/infinispan/lucene/CacheTestSupport.java
/**
    * Used in test to remove all documents containing some term
    *
    * @param dir The Directory containing the Index to verify
    * @param term
    */
Used in test to remove all documents containing some term
@param dir The Directory containing the Index to verify
@param term
Used in test to remove all documents containing some term @param dir The Directory containing the Index to verify @param term
public static void removeByTerm(Directory dir, String term) throws IOException {
      IndexWriterConfig indexWriterConfig = new IndexWriterConfig(LuceneSettings.analyzer);
      IndexWriter iw = new IndexWriter(dir, indexWriterConfig);
      iw.deleteDocuments(new Term("body", term));
      iw.commit();
      iw.close();
   }
public static void removeByTerm ( Directory dir , String term ) throws IOException { IndexWriterConfig indexWriterConfig = new IndexWriterConfig ( LuceneSettings . analyzer ) ; IndexWriter iw = new IndexWriter ( dir , indexWriterConfig ) ; iw . deleteDocuments ( new Term ( "body" , term ) ) ; iw . commit ( ) ; iw . close ( ) ; }
Used in test to remove all documents containing some term
 @param dir The Directory containing the Index to verify
 @param term
Used in test to remove all documents containing some term @param dir The Directory containing the Index to verify @param term