修改线上null
This commit is contained in:
@@ -24,41 +24,17 @@ def find_around_price(city_now, lng, lat):
|
||||
"""
|
||||
if pd.isna(lng):
|
||||
return None
|
||||
filter = []
|
||||
filter_query = []
|
||||
if pd.notna(city_now):
|
||||
filter.append({
|
||||
"term": {
|
||||
"city": {
|
||||
"value": city_now
|
||||
}
|
||||
}
|
||||
})
|
||||
filter.append({
|
||||
"terms": {
|
||||
"tag": [
|
||||
"美食;中餐厅",
|
||||
"美食;外国餐厅"
|
||||
]
|
||||
}
|
||||
})
|
||||
filter.append({
|
||||
"range": {
|
||||
"price": {
|
||||
"gte": 10,
|
||||
"lte": 300
|
||||
}
|
||||
}
|
||||
})
|
||||
filter.append({
|
||||
"geo_distance": {
|
||||
"distance": 1000,
|
||||
"location": [lng, lat]
|
||||
}
|
||||
})
|
||||
filter_query.append({"term": {"city": {"value": city_now}}})
|
||||
filter_query.append({"terms": {"tag": ["美食;中餐厅", "美食;外国餐厅"]}})
|
||||
filter_query.append({"range": {"price": {"gte": 10, "lte": 300}}})
|
||||
filter_query.append({"geo_distance": {"distance": 1000, "location": [lng, lat]}})
|
||||
|
||||
ret_es = es206_client.elastic_client.search({
|
||||
"query": {
|
||||
"bool": {
|
||||
"filter": filter
|
||||
"filter": filter_query
|
||||
}
|
||||
},
|
||||
"size": 0,
|
||||
|
||||
Reference in New Issue
Block a user