index.setParent(this);
index.setBuildTime(buildTime);
sortIndexes.add(index);
// Also create an index for the inverted sort.
DataSetSort invertedSortOp = sortOp.cloneInstance().invertOrder();
List<Integer> invertedRows = new ArrayList<Integer>(sortedRows);
Collections.reverse(invertedRows);
DataSetSortIndex invertedIndex = new DataSetSortIndex(invertedSortOp, invertedRows);
invertedIndex.setParent(this);
sortIndexes.add(invertedIndex);