Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion rorapi/common/matching_single_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,12 @@ def match_by_query(text, query, countries):
chosen_candidate = None
chosen_true = None
results = query.execute()
candidates = results.hits.hits
except Exception as e:
return f"query error: {e}", None
try:
candidates = results.hits.hits
except Exception as e:
return f"candidates error: {e}\n{results}", None
if candidates:
candidates = [c for c in candidates if c["_source"]["status"] == "active"]
scored_candidates = [score(text, c) for c in candidates]
Expand Down