A General Framework for Searching on a Line