Fixes bug 838747 - Made the list of indexes generation for elasticsearch

I guess this is something for @peterbe or @lonnen to review. :)