Add update_g_idx flag for setting qweight&g_idx
#2143
Merged
update_g_idx flag for setting qweight&g_idx
#2143