Sort by index.