Create a reversed map id -> index for faster searching