lucene/lucene-directory/src/test/java/org/infinispan/lucene/CacheTestSupport.java
/**
    * Optimizing an index is not recommended nowadays, still it's an interesting
    * byte-shuffling exercise to test.
    */
Optimizing an index is not recommended nowadays, still it's an interesting
byte-shuffling exercise to test.
Optimizing an index is not recommended nowadays still it ' s an interesting byte - shuffling exercise to test .
public static void optimizeIndex(Directory dir) throws IOException {
      IndexWriterConfig indexWriterConfig = new IndexWriterConfig(LuceneSettings.analyzer);
      IndexWriter iw = new IndexWriter(dir, indexWriterConfig);
      iw.forceMerge(1, true);
      iw.close();
   }
public static void optimizeIndex ( Directory dir ) throws IOException { IndexWriterConfig indexWriterConfig = new IndexWriterConfig ( LuceneSettings . analyzer ) ; IndexWriter iw = new IndexWriter ( dir , indexWriterConfig ) ; iw . forceMerge ( 1 , true ) ; iw . close ( ) ; }
Optimizing an index is not recommended nowadays, still it's an interesting
 byte-shuffling exercise to test.
Optimizing an index is not recommended nowadays still it ' s an interesting byte - shuffling exercise to test .