Sorts documents of a given index by returning a permutation on the document IDs.
A permutation of doc IDs. For every document ID between 0 and , oldToNew(newToOld(docID)) must return docID.
0
oldToNew(newToOld(docID))
docID
Returns a mapping from the old document ID to its new location in the sorted index. Implementations can use the auxiliary .sort to compute the old-to-new permutation given a list of documents and their corresponding values.