小编sur*_*ind的帖子

弹性搜索 - 无法创建查询

我在inner_hits使用 Python 弹性搜索访问数据时遇到了问题。我越来越

RequestError(400,'search_phase_execution_exception', 'failed to create query'

当我尝试使用inner_hits{}.
我的弹性搜索版本 6.5.4,python 版本 3.7.2。

from elasticsearch import Elasticsearch
es = Elasticsearch()


mapping = '''{
        "mappings": {
    "tablets": {
      "properties": {
        "Names": {
          "type": "nested"
          "properties":{
              "ID": {"type" : "long"},
              "Combination": {"type" : "text"},
              "Synonyms": {"type" : "text"}
          }
        }
      }
    }
  }
}'''

es.indices.create(index="2", ignore=400, body=mapping)

tablets = {
    "Names":[
    {
    "ID" : 1,    
    "Combination": "Paracetamol",
    "Synonyms": "Crocin"
    },{
    "ID" : 2,
    "Combination": "Pantaprazole",
    "Synonyms": "Pantap"
    }]} …
Run Code Online (Sandbox Code Playgroud)

python nested elasticsearch

3
推荐指数
1
解决办法
6389
查看次数

标签 统计

elasticsearch ×1

nested ×1

python ×1