We formalize R&D as a search process for technology improvements across different technological domains. Technology improvements from a specific domain draw upon a common knowledge base, and as such they share technological content. Moreover, different domains may rely on similar scientific principles, and therefore, knowledge about the technology improvements by one domain might be transferable to another. We analyze how such a technological relatedness shapes the direction of R&D search when knowledge generated from past search efforts disseminates to rival firms. We show that firms optimally diversify their search efforts, even toward domains that are riskier and less promising on expectation. This is amplified for higher competition intensity, i.e., higher cross-product substitutability. Our work also suggests that different sources of learning about the domains may have opposite effects on the direction of search. Higher ability to infer the potential of an explored domain prompts the clustering of searches, whereas the ability to learn across domains prompts diversification. Finally, we discuss the technological landscape properties that prompt firms to engage in a sequential R&D search, instead of a parallel competitive search.