How to add Google Custom Search Engine to Discourse

Earlier when discourse search threw zero results, then there appeared a button labelled ‘search your site with google’.
It was no more helpful than just to open google search with already filled with this:

"site:yoursitename.com "