Lots of folks misremember how the Unity Home Lens feature actually worked, and that the Ubuntu installer explicitly asked you whether you wanted it enabled.
If enabled, there was no presumption of local-only search. It was front and center in your search results, and the affiliate revenue was only collected when you clicked on that Amazon result.
Canonical claimed that the search was forwarded to them, and then anonymized to Amazon. That's more than what Microsoft seems to do with Bing results in Windows search, which you can't seem to disable without installing third-party scripts.
Was it a perfect solution? No - But it was a way to make revenue in an otherwise open-source project and free of cost. Its interesting how on some days, people argue for more money towards FOSS devs, and then others argue that revenue-building systems shouldn't be implemented. Yeah, Canonical makes enterprise investments, but they're obviously weren't in the realm of Red Hat in terms of enterprise support.