From 801a6ef356124bb88552865a95bdf02a48ca3ae5 Mon Sep 17 00:00:00 2001 From: MJedr Date: Fri, 22 Sep 2023 17:13:13 +0200 Subject: [PATCH] fuzzy matching: change request payload --- inspirehep/modules/workflows/tasks/matching.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/inspirehep/modules/workflows/tasks/matching.py b/inspirehep/modules/workflows/tasks/matching.py index 07c69d5209..935c5a77f8 100644 --- a/inspirehep/modules/workflows/tasks/matching.py +++ b/inspirehep/modules/workflows/tasks/matching.py @@ -113,6 +113,14 @@ def fuzzy_match(obj, eng): ``False`` otherwise. """ + fuzzy_matching_data_keys = [ + 'abstracts', + 'authors', + 'titles', + 'report_numbers', + 'arxiv_eprints' + ] + fuzzy_match_data = {key: val for key, val in obj.data.iteritems() if key in fuzzy_matching_data_keys} matching_response = requests.get( "{inspirehep_url}/matcher/fuzzy-match".format( inspirehep_url=current_app.config["INSPIREHEP_URL"] @@ -120,7 +128,7 @@ def fuzzy_match(obj, eng): headers=_get_headers_for_hep_root_table_request(), data=json.dumps( { - "data": obj.data, + "data": fuzzy_match_data, } ), )