The need for domain knowledge representation for program comprehension is now widely accepted in the program comprehension community. The so-called "concept assignment problem" represents the challenge to locate domain concepts in the source code of programs. The vast majority of attempts to solve it are based on static source code search for clues to domain concepts. In contrast, our approach is based on dynamic analysis using information retrieval (IR) metrics. First we explain how we modeled the domain concepts and their role in program comprehension. Next we present how some of the popular IR metrics could be adapted to the "concept assignment problem" and the way we implemented the search engine. Then we present our own metric and the performance of these metrics to retrieve domain concepts in source code. The contribution of the paper is to show how the IR metrics could be applied to the "concept assignment problem" when the "documents" to retrieve are domain concepts structured in an ontology.