【问题标题】:Creating elasticsearch-dsl DocType objects from dict or json从 dict 或 json 创建 elasticsearch-dsl DocType 对象
【发布时间】:2017-07-25 07:58:35
【问题描述】:

我正在使用elasticsearch-dsl 库来定义elasticsearch 中的映射并索引django 模型对象。但是,对于初始索引,我想对所有模型使用 json 数据。有没有办法直接从json 或python dict 实例化DocType 子类对象?

【问题讨论】:

    标签: python json django elasticsearch-dsl


    【解决方案1】:

    你总是可以MyDoc(**my_dict)

    【讨论】:

      猜你喜欢
      • 2016-02-18
      • 2016-04-24
      • 1970-01-01
      • 1970-01-01
      • 2022-01-21
      • 1970-01-01
      • 1970-01-01
      • 2021-12-30
      • 1970-01-01
      相关资源
      最近更新 更多