^Most of the time, there are other algorithms in place. These days, if you have a Google account and you are logged in while searching for something (or if Google recognises your IP, I think), your search results are filtered to suit your browsing history.
Of course, if you use Google mail, they have code that scans the contents for keywords. Those keywords form the basis for the ads you see while reading your mail, and I suspect they are also used to further filter your search results.
I think it's amusing that people are upset when they hear about the NSA snooping but generally look the other way when Google does it. That, obviously, is why the NSA wants to tap into their databases.
If they joined forces, they could create the ultimate search engine.