1) PSO can be used with one variable (I suppose that with the "indices" word you are referring to one variable in your problem), but
2) PSO and other swarm and evolutionary methods were created to solve complex problems, where traditional optimization methods do not are applicable or spend much time to solve them.
If your problem has only one variable, I think that you should try to solve the problem with a traditional univariate optimization method, and if it is not possible, then apply one trajectory-based method such as Simulated Annealing or VNS, by example.