Exploiting the Index Gradients for Optimization-Based Jailbreaking on Large Language Models