fix search result for terms with multiple substitutions