From 078b22ba47466e9ed4a41efb0e786e0dee536e32 Mon Sep 17 00:00:00 2001 From: "shenjian@fangjia.com" Date: Tue, 1 Nov 2022 10:32:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=B9=BC=E5=84=BF=E5=9B=AD?= =?UTF-8?q?=E3=80=81=E5=A4=A7=E5=AD=A6=E5=90=8C=E6=AD=A5=E8=87=B3206?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dags/business/business/community/education.py | 24 +++++-------------- 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/dags/business/business/community/education.py b/dags/business/business/community/education.py index faa1623..b41edd5 100644 --- a/dags/business/business/community/education.py +++ b/dags/business/business/community/education.py @@ -36,23 +36,11 @@ def deal(actions, item): if len(kindergarten) > 0: doc_info['kindergarten'] = ",".join(kindergarten) - # 超市 - supermarket = poiutils.find_around_by_location(curr_city, 1000, [lng, lat], "学校", "小学") - doc_info['supermarket_num'] = len(supermarket) - if len(supermarket) > 0: - doc_info['supermarket'] = ",".join(supermarket) - - # 公园 - park = poiutils.find_around_by_location(curr_city, 1000, [lng, lat], "生活配套", "公园") - doc_info['park_num'] = len(park) - if len(park) > 0: - doc_info['park'] = ",".join(park) - - # 餐厅 - catering = poiutils.find_around_by_location(curr_city, 1000, [lng, lat], "生活配套", "餐厅") - doc_info['catering_num'] = len(catering) - if len(catering) > 0: - doc_info['catering'] = ",".join(catering) + # 大学 + university = poiutils.find_around_by_location(curr_city, 5000, [lng, lat], "学校", "大学") + doc_info['university_num'] = len(university) + if len(university) > 0: + doc_info['university'] = ",".join(university) action = { "_op_type": "update", @@ -75,7 +63,7 @@ def deal(actions, item): def sync(city=None): - log.info(f"开始同步教育资源至206 {index_name}") + log.info(f"开始同步教育资源【幼儿园、大学】至206 {index_name}") seaweed_query = {'status': 0, 'cat': 'district'} if pd.notna(city): seaweed_query['city'] = city