refactor search history logic so we're pulling search query parameters out of the database, not the session.
refactor previous/next docs to use only a single extra solr query.