Generalize Connection.search