The old search view code caught socket.timeout and socket.error exceptions and handled them. The new code in oedipus didn't. Turns out these errors happen a lot in production. This adds handling for those errors and also counts them with statsd so we can see how big the problem is without getting a ton of error email.
Previously, we did a db hit for every search result in each group (wiki, forums, questions) that was being queried. Now, we only do a db hit for each search result that's being displayed and further, we now do the queries in batches. This works by fiddling with lists of object ids to figure out exactly what we're showing and then slicing the groups such that we're only looking at search results that are going to get shown.