我是彈性搜索的新手
所以我試圖用特定的'doc_type'創建一個檔案,但是當我傳入 doc_type 引數時,我收到了這個錯誤:
elasticsearch.exceptions.RequestError: RequestError(400, '沒有找到 uri [/employees/teacher/1] 和方法 [PUT] 的處理程式', '沒有找到 uri [/employees/teacher/1] 和方法 [PUT] 的處理程式] ')
有誰知道出了什么問題?
我的代碼:
es = Elasticsearch(
["localhost"],
port=9200,
connection_class=RequestsHttpConnection,
http_auth=("elastic", "elastic"),
use_ssl=True,
verify_certs=False
)
body = {
'name': 'John',
'age': 21
}
# es.indices.create(index = 'employees')
# This line works fine
es.index(index='employees', id = 1, body = body, refresh = 'true' )
# This line caused the error
es.index(index='employees', doc_type='teacher', id = 1, body = body )
uj5u.com熱心網友回復:
映射型別(又名 doc_type)已被棄用,您應該像在第一個陳述句中那樣簡單地使用_doc或不指定引數。doc_typees.index()
從 8.0.0 版開始,doc_type甚至已從可用引數中洗掉。
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/514337.html
標籤:Python弹性搜索
上一篇:type=search_phase_execution_exception,原因=我發送'/'時所有分片都失敗
下一篇:Kibana-更新默認搜索查詢
