Wasn't the intent of the exercise to gain a DNA sample? If so it was an unwarranted search. I think the police may be on shaky ground.
Not necessarily. The police were invited to come inside and the suspect voluntarily met with the officer. The DNA sample was not requested, the suspect provide it on his own. There is no invasion of his rights.
Undercover operations include the officer being able to provide a front to get access to the criminal.
What it all comes down to though will be the political leanings of the court and appeals court that hears the case.
I look at it as good preparation and planning by the police. The cover was provided and the story got him access to the suspect. Nothing illegal about that.
I couldn't say what the rules on something like this are. This happened in Australia. They don't necessarily have the same rules.
He sure had a hard time coming up with anything that sounded like "yes" in answer to the "did you think it was legal" question.
Where is the search? The officers did not search him to obtain a sample. They asked for a map, which luckily included spittle which contained his DNA.