Add index to entities