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