Roger Federer battled his way through to the semi-finals of the BNP Paribas Open at Indian Wells after beating Hubert Hurkacz, 6-4, 6-4.