Move the permutations logic into the index. This simplifies the fallback
implementation as well.