0
我正在使用elasticsearch
的Python客戶端和elasticsearch-dsl
以及。我創建了索引IndexName
,並驗證了索引的存在。我有一個doc_type DocumentModelIndex
與此IndexName
相關聯。elasticsearch(Python/Django)批量索引拋出否索引錯誤
def bulk_indexing():
from app.models import DocumentModel
DocumentModelIndex.init(index=settings.ES_INDEX)
es = Elasticsearch()
bulk(client=es,actions=(b.indexing()
for b in DocumentModel.objects.all().iterator()))
當我運行上面的代碼時,出現以下錯誤:ValidationException: No index
。
我試圖把文件成指數使用: 捲曲-XPOST 「http://localhost:9200/index_name/document_model_index/」 -d 「{\」 源\ 「:\」 谷歌\ 「}」 和這個工作。
我是elasticsearch
的新手,我無法弄清楚這一點。任何幫助將非常感激!