Added areFieldsIndexedForSorting and Tests