- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我想从特定索引和 Elasticsearch 中读取特定类型的文档。我构造查询:
es.search(index="document_index, doc_type="document_type", body={"query": {"match_all": {}}})['hits']['total']
我收到错误 TypeError: search() got an unexpected keyword argument 'doc_type'
。我通过下面给出的几个链接来寻找解决方案,但到处都是主要答案是降级 ES 版本。但是我们的要求是保留 ES 5.6 版本。
还有一些
是否有其他方法来提及文档类型?
最佳答案
看来您的 elasticsearch python 客户端版本高于 v5.6
。删除具有 doc_type
兼容版本的现有版本,例如 5.5.3
移除:pip uninstall elasticsearch
然后安装 pip install elasticsearch==5.5.3
N.B 我建议这样做,因为使用 doc_type
关于python - 类型错误 : search() got an unexpected keyword argument 'doc_type' for elastic search version 5. 6,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56677645/
Elasticsearch 6.0中的“重大更改”之一是删除索引中的多种映射类型。 release notice指出 The ability to have multiple mapping type
class Article(Document): title = Text(analyzer='snowball', fields={'raw': Keyword()}) body =
我正在使用以下库通过 flex 搜索创建django API: Django-rest-framework django-elasticsearch-dsl django-elasticsearch-
我想从特定索引和 Elasticsearch 中读取特定类型的文档。我构造查询: es.search(index="document_index, doc_type="document_type",
我是一名优秀的程序员,十分优秀!