Sorter (Lucene 10.5.0 core API)
Description: declaration: package: org.apache.lucene.index, class: Sorter

Package org.apache.lucene.index

# Class Sorter

java.lang.Object
org.apache.lucene.index.Sorter

public final class Sorter extends Object
Sorts documents of a given index by returning a permutation on the document IDs.

WARNING: This API is experimental and might change in incompatible ways in the next release.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `Sorter.DocMap`
  A permutation of doc IDs.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getID()`
  Returns the identifier of this `Sorter`.
  `String`
  `toString()`

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

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

- ## Method Details

  - ### getID

    public String getID()
    Returns the identifier of this `Sorter`.

    This identifier is similar to `Object.hashCode()` and should be chosen so that two instances of this class that sort documents likewise will have the same identifier. On the contrary, this identifier should be different on different `sorts`.

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`