generate index on the server side