版本修改
This commit is contained in:
@@ -9,16 +9,8 @@ from goojia_utils import DIDATA_DEV_ELASTIC_CLIENT, threads, geohashutils, areau
|
|||||||
import pandas as pd
|
import pandas as pd
|
||||||
from elasticsearch import helpers
|
from elasticsearch import helpers
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
# 🛡️ 2. 终极绝招:利用 Elasticsearch 8.x 官方 options() 机制,强行生成一个无 compatible 请求头的底层客户端并覆盖,彻底降维打击 406 报错!
|
|
||||||
if hasattr(DIDATA_DEV_ELASTIC_CLIENT.elastic_client, 'options'):
|
|
||||||
DIDATA_DEV_ELASTIC_CLIENT.elastic_client = DIDATA_DEV_ELASTIC_CLIENT.elastic_client.options(
|
|
||||||
headers={"content-type": "application/json", "accept": "application/json"}
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
# ================== 🛡️ 安全运行入口 ==================
|
# ================== 🛡️ 安全运行入口 ==================
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
Reference in New Issue
Block a user