10
$\begingroup$

Regulars know that the built-in site search often fails to find relevant posts. Using the same search term in Google and adding site:math.stackexchange.com tends to bring more relevant results; this is mentioned many times on Meta. But typing the site parameter every time is tiresome. Is there a better way?

$\endgroup$
  • 7
    $\begingroup$ A lifehack: if you use site:... (some words) (instead of more natural (some words) site:...) autocompletion reduces typing drastically $\endgroup$ – Grigory M Jun 6 '14 at 19:43
9
$\begingroup$

Yes, the bookmarklet Search with Google from this page takes care of the boring part. After entering the search terms in the site search box, click the bookmarklet instead of hitting Enter.

This also works if you already hit Enter, looked through the results and were left disappointed. No need to retype or copy-paste the search terms: just click the bookmarklet.

Also works on other SE sites.


Bookmarklets cannot be contained within post body, hence the external page. In case something happens to the page, the script (compressed and URL encoded) is below.

javascript:(function()%7Bs%3Ddocument.querySelector('.search-container%20input').value%3Bu%3DencodeURI('%2F%2Fgoogle.com%2Fsearch%3Fq%3D'%2Bs%2B'%20site%3A'%2Bwindow.location.hostname)%3Bwindow.location.replace(u)%7D)()
$\endgroup$
  • 2
    $\begingroup$ Maybe it's time you compile all these into a gigantic Greasemonkey script. $\endgroup$ – Asaf Karagila Jun 6 '14 at 20:06
  • 3
    $\begingroup$ @AsafKaragila I considered that, actually. But script installation is more work for users not familiar with the technology. And it's more work for me to insert elements into page that would trigger the script. So it's status-deferred. $\endgroup$ – user147263 Jun 6 '14 at 20:30

You must log in to answer this question.