Add flag to allow doc keys to be sorted alphabetically