Class Sorter.DocMap

java.lang.Object
org.apache.lucene.index.Sorter.DocMap
Enclosing class:
Sorter

abstract static class Sorter.DocMap extends Object
A permutation of doc IDs. For every document ID between 0 and IndexReader.maxDoc(), oldToNew(newToOld(docID)) must return docID.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) abstract int
    newToOld(int docID)
    Given the ordinal of a doc ID, return its doc ID in the original index.
    (package private) abstract int
    oldToNew(int docID)
    Given a doc ID from the original index, return its ordinal in the sorted index.
    (package private) abstract int
    Return the number of documents in this map.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DocMap

      DocMap()
  • Method Details

    • oldToNew

      abstract int oldToNew(int docID)
      Given a doc ID from the original index, return its ordinal in the sorted index.
    • newToOld

      abstract int newToOld(int docID)
      Given the ordinal of a doc ID, return its doc ID in the original index.
    • size

      abstract int size()
      Return the number of documents in this map. This must be equal to the number of documents of the LeafReader which is sorted.