# Package org.apache.lucene.index

Misc index tools and index support.

See: Description

- Class Summary
  Class | Description
  --- | ---
  IndexSplitter | Command-line tool that enables listing segments in an index, copying specific segments to another index, and deleting segments from an index.
  MultiPassIndexSplitter | This tool splits input index into multiple equal parts.
  PKIndexSplitter | Split an index based on a `Query`.
  SortingLeafReader | An `LeafReader` which supports sorting documents by a given `Sort`.
  SortingMergePolicy | A `MergePolicy` that reorders documents according to a `Sort` before merging them.

## Package org.apache.lucene.index Description

Misc index tools and index support. SortingMergePolicy:

Provides index sorting capablities. The application can use any Sort specification, e.g. to sort by fields using DocValues or FieldCache, or to reverse the order of the documents (by using SortField.Type.DOC in reverse). Multi-level sorts can be specified the same way you would when searching, by building Sort from multiple SortFields.

`SortingMergePolicy` can be used to make Lucene sort segments before merging them. This will ensure that every segment resulting from a merge will be sorted according to the provided `Sort`. This however makes merging and thus indexing slower.

Sorted segments allow for early query termination when the sort order matches index order. This makes query execution faster since not all documents need to be visited. Please note that this is an expert feature and should not be used without a deep understanding of Lucene merging and document collection.

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