Updated index generation for multi primitive fields

Signed-off-by: Tom Wright <tom@inflatablecookie.com>