[UPDATE] support returning both indices and values.