fix: 索引器使用 api-version 2025-09-01 创建
Made-with: Cursor
This commit is contained in:
@@ -20,6 +20,7 @@ if os.path.exists(SETTINGS_PATH):
|
||||
ENDPOINT = os.environ.get("AZURE_SEARCH_ENDPOINT", "").rstrip("/")
|
||||
API_KEY = os.environ.get("AZURE_SEARCH_API_KEY", "")
|
||||
API_VERSION = "2024-07-01"
|
||||
INDEXER_API_VERSION = "2025-09-01" # 索引器创建需较新版本
|
||||
|
||||
|
||||
def _headers():
|
||||
@@ -288,7 +289,7 @@ def create_datasource_skillset_indexer():
|
||||
],
|
||||
}
|
||||
try:
|
||||
_put(f"/indexers('{idx_name}'){base}", indexer_body)
|
||||
_put(f"/indexers('{idx_name}')?api-version={INDEXER_API_VERSION}", indexer_body)
|
||||
print(f"已创建/更新索引器: {idx_name}")
|
||||
except Exception as e:
|
||||
print(f"创建索引器失败: {e}")
|
||||
|
||||
Reference in New Issue
Block a user