Class IndexSplitter


  • public class IndexSplitter
    extends Object
    Command-line tool that enables listing segments in an index, copying specific segments to another index, and deleting segments from an index.

    This tool does file-level copying of segments files. This means it's unable to split apart a single segment into multiple segments. For example if your index is a single segment, this tool won't help. Also, it does basic file-level copying (using simple File{In,Out}putStream) so it will not work with non FSDirectory Directory impls.

    WARNING: This API is experimental and might change in incompatible ways in the next release.
    You can easily accidentally remove segments from your index so be careful!

    NOTE: this tool is unaware of documents added atomically via IndexWriter.addDocuments(java.util.Collection<org.apache.lucene.document.Document>) or IndexWriter.updateDocuments(org.apache.lucene.index.Term, java.util.Collection<org.apache.lucene.document.Document>), which means it can easily break up such document groups.