瀏覽代碼

update:切换 ex7.x

dongzhaorui 2 年之前
父節點
當前提交
42686de0ac
共有 1 個文件被更改,包括 2 次插入3 次删除
  1. 2 3
      A数据处理/sync_data/send_data.py

+ 2 - 3
A数据处理/sync_data/send_data.py

@@ -81,7 +81,7 @@ mongodb = mcli[MONGO_DB]
 
 
 # es
 # es
 ES_HOST = "172.17.145.178"
 ES_HOST = "172.17.145.178"
-ES_PORT = 9800
+ES_PORT = 9200
 ES_INDEX = "biddingall"
 ES_INDEX = "biddingall"
 ecli = Elasticsearch([{"host": ES_HOST, "port": ES_PORT}])
 ecli = Elasticsearch([{"host": ES_HOST, "port": ES_PORT}])
 
 
@@ -144,8 +144,7 @@ def es_query(title, publish_time):
         }
         }
     }
     }
     result = ecli.search(body=query, index=ES_INDEX, request_timeout=100)
     result = ecli.search(body=query, index=ES_INDEX, request_timeout=100)
-    total = int(result["hits"]["total"])  # es1.x版本(即将废弃)
-    # total = int(result["hits"]["total"]['value']) # es7.x版本(等待切换)
+    total = int(result["hits"]["total"]['value']) # es7.x版本(等待切换)
     return total
     return total