Earlier quoted context omitted.
That's pretty neat. Didn't know that. Thanks!
And if you set num=0 then it returns the normal "did not match any documents" page: https://www.google.com/search?num=0&q=temperature+london Which seems like it could be used to fool someone into thinking there really are no results for a subject. Or to pretend Google search is broken ;)
Ask HN: Why does Google put the query in the URL hash instead of query string?
21–30 of 71 posts
Re: Ask HN: Why does Google put the query in the URL hash instead of query string?
#22Earlier quoted context omitted.
Correct. The only service which can provide you with google queries is google analytics. So if you want the data, you are forced to help spread the google drag net across the internet.
No. Keywords do not appear in Google Analytics since search switched to HTTPS. The query strings are dropped going from HTTPS to HTTP. Keywords will show up as "(not provided)"(Disclaimer: I work at Google but I'm not on the search team. I do use Google Analytics.)
Re: Ask HN: Why does Google put the query in the URL hash instead of query string?
#23If you are search from any place (toolbar, addressbar) other than google.com, your search query would be passed in as a query string. But once you are already on google.com search page, the entire page need not be reloaded. So google would fetch the search results for the new search string via a XHR and update the page. In fact if you search for https://www.google.com/search?q=wonderland#q=alice , the webpage would f…
They could use `pushState` to change the query without reloading the page?
The hash state has been there since Instant Search was launched in 2010.
Re: Ask HN: Why does Google put the query in the URL hash instead of query string?
#24On a related note, and probably obvious to many, I've just discovered I can make a nice little link to a one-result search, handy for a bookmark. Things like current temperature and forecast I don't want a dedicated app for when a simple search is more efficient... https://www.google.com/search?num=1&q=temperature+london
Re: Ask HN: Why does Google put the query in the URL hash instead of query string?
#25On a related note, and probably obvious to many, I've just discovered I can make a nice little link to a one-result search, handy for a bookmark. Things like current temperature and forecast I don't want a dedicated app for when a simple search is more efficient... https://www.google.com/search?num=1&q=temperature+london
That's pretty neat. Didn't know that. Thanks!
Re: Ask HN: Why does Google put the query in the URL hash instead of query string?
#26On a related note, and probably obvious to many, I've just discovered I can make a nice little link to a one-result search, handy for a bookmark. Things like current temperature and forecast I don't want a dedicated app for when a simple search is more efficient... https://www.google.com/search?num=1&q=temperature+london
https://support.mozilla.org/en-US/kb/how-search-from-address...
For example, I directly go to Wikipedia's page on "India " by typing wp India in my address bar using these search keywords, or search images of birds on google by typing gi birds in it.
(There's a rather cumbersome way to do the same in Chrome as well)
Re: Ask HN: Why does Google put the query in the URL hash instead of query string?
#27Earlier quoted context omitted.
Interesting that your alice/wonderland example works. Would've thought Google would try to prevent that.
As far as Google are concerned it makes no difference if the query is a GET variable in the URL or a hash fragment that their JS code sends as a query after the search page is loaded. They both mean "load Google Search with this parameter from the URL".
Re: Ask HN: Why does Google put the query in the URL hash instead of query string?
#28On a related note, and probably obvious to many, I've just discovered I can make a nice little link to a one-result search, handy for a bookmark. Things like current temperature and forecast I don't want a dedicated app for when a simple search is more efficient... https://www.google.com/search?num=1&q=temperature+london
Yes, and if you're using Firefox, you can this with the knowledge of its Smart Keywords to create super quick shortcuts! https://support.mozilla.org/en-US/kb/how-search-from-address... For example, I directly go to Wikipedia's page on "India " by typing wp India in my address bar using these search keywords, or search images of birds on google by typing gi birds in it. (There's a rather cumbersome way to do the same…
Re: Ask HN: Why does Google put the query in the URL hash instead of query string?
#29Re: Ask HN: Why does Google put the query in the URL hash instead of query string?
#30On a related note, and probably obvious to many, I've just discovered I can make a nice little link to a one-result search, handy for a bookmark. Things like current temperature and forecast I don't want a dedicated app for when a simple search is more efficient... https://www.google.com/search?num=1&q=temperature+london
Yes, and if you're using Firefox, you can this with the knowledge of its Smart Keywords to create super quick shortcuts! https://support.mozilla.org/en-US/kb/how-search-from-address... For example, I directly go to Wikipedia's page on "India " by typing wp India in my address bar using these search keywords, or search images of birds on google by typing gi birds in it. (There's a rather cumbersome way to do the same…