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