@@ -251,8 +251,8 @@ def match_by_query(text, query, countries):
251251 if candidates :
252252 candidates = [c for c in candidates if c ["_source" ]["status" ] == "active" ]
253253 scored_candidates = [score (text , c ) for c in candidates ]
254- scored_candidates = [s for s in scored_candidates if s .score >= MIN_SCORE ]
255254 scored_candidates_to_return = [s for s in scored_candidates if s .score >= MIN_SCORE_FOR_RETURN ]
255+ scored_candidates = [s for s in scored_candidates if s .score >= MIN_SCORE ]
256256 if scored_candidates :
257257 if (len (scored_candidates ) == 1 ) and (scored_candidates [0 ].score >= MIN_SCORE ):
258258 chosen_candidate = scored_candidates [0 ]
@@ -305,19 +305,15 @@ def get_candidates(aff, countries, version):
305305 return match_by_query (aff , qb .get_query (), countries )
306306
307307
308- def match_affiliation (affiliation , active_only , version ):
308+ def match_affiliation (affiliation , version ):
309309 countries = get_countries (affiliation )
310310 chosen , all_matched = get_candidates (affiliation , countries , version )
311- return get_output (chosen , all_matched , active_only )
311+ return get_output (chosen , all_matched )
312312
313313
314314def match_organizations (params , version ):
315315 if "affiliation" in params :
316- active_only = True
317- if "all_status" in params :
318- if params ["all_status" ] == "" or params ["all_status" ].lower () == "true" :
319- active_only = False
320- matched = match_affiliation (params .get ("affiliation" ), active_only , version )
316+ matched = match_affiliation (params .get ("affiliation" ), version )
321317
322318 if version == "v2" :
323319 return None , MatchingResultV2 (matched )
0 commit comments