最近商圈不限制距离
This commit is contained in:
@@ -19,7 +19,7 @@ count = 0
|
||||
mutex = Lock()
|
||||
|
||||
|
||||
def find_nearest_by_location(city, distance, location):
|
||||
def find_nearest_by_location(city, location):
|
||||
try:
|
||||
scan = es206_client.scan('business_district', {
|
||||
"size": 1,
|
||||
@@ -30,12 +30,6 @@ def find_nearest_by_location(city, distance, location):
|
||||
"term": {
|
||||
"city": city
|
||||
}
|
||||
},
|
||||
{
|
||||
"geo_distance": {
|
||||
"distance": distance,
|
||||
"location": location
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -68,7 +62,7 @@ def deal(actions, item):
|
||||
|
||||
doc_info = dict()
|
||||
# 商圈
|
||||
business_district_doc = find_nearest_by_location(curr_city, 10000, [lng, lat])
|
||||
business_district_doc = find_nearest_by_location(curr_city, [lng, lat])
|
||||
if pd.isna(business_district_doc):
|
||||
return
|
||||
doc_info['nearest_business_district_distance'] = int(business_district_doc['sort'][0])
|
||||
|
||||
Reference in New Issue
Block a user