index() 缺少 1 个必需的位置参数:“doc_type”

index() missing 1 required positional argument: 'doc_type'

提问人:Gabii Enríquez 提问时间:11/23/2022 更新时间:11/23/2022 访问量:181

问:

mapping = {
    "mappings": {
        "properties": {
            "Id_centro":{ "type": "keyword" },
            "RFC":{ "type": "text" },
            "Razon_Social":{ "type": "text" },
            "Entidad_Federativa":{ "type": "text" },
            "Tipo_De_Centro":{ "type": "text" },
            "Nivel_Centro":{ "type": "text" }
        }
    }
}

Este es el mapeo del indice creado, para agregar el mapeo se utiliza la siguiente linea

es.index(index=“centro”, id=1, body=映射)

El mensaje de error es:

TypeError: index() missing 1 required positional argument: 'doc_type'

Elasticsearch 版本 8.5.0

Elasticsearch 映射 文档类型

评论

0赞 Amit 11/23/2022
您需要在索引请求中使用_doc
0赞 Sagar Patel 11/23/2022
您的 Python Elasticsearch 客户端版本是什么?

答: 暂无答案