def test_total_matches(self):
     expected = 2
     actual = SolrRepository.total_matches("seafood")
     self.assertEqual(actual, expected)
 def calculate_recall(query, results):
     correct_matches = CandidateSolution.discounted_correct_matches(query, results)
     total_matches = float(SolrRepository.total_matches(query))
     missed_matches = total_matches - correct_matches
     return correct_matches / (correct_matches + missed_matches)