修改线上null

This commit is contained in:
shenjian@fangjia.com
2023-03-09 15:09:42 +08:00
parent 44cee71ce3
commit 25d046cc6e
+7 -31
View File
@@ -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,