org.apache.lucene.index

## Class IndexSplitter

- java.lang.Object
- - org.apache.lucene.index.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!

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `SegmentInfos` | `infos`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `IndexSplitter(Path dir)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `listSegments()`
    `static void` | `main(String[] args)`
    `void` | `remove(String[] segs)`
    `void` | `split(Path destDir, String[] segs)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### infos

          public final SegmentInfos infos

  - ### Constructor Detail

    - #### IndexSplitter

          public IndexSplitter(Path dir)
                        throws IOException

      Throws:
        `IOException`

  - ### Method Detail

    - #### main

          public static void main(String[] args)
                           throws Exception

      Throws:
        `Exception`

    - #### listSegments

          public void listSegments()
                            throws IOException

      Throws:
        `IOException`

    - #### remove

          public void remove(String[] segs)
                      throws IOException

      Throws:
        `IOException`

    - #### split

          public void split(Path destDir,
                            String[] segs)
                     throws IOException

      Throws:
        `IOException`

Copyright © 2000-2022 Apache Software Foundation. All Rights Reserved.