elasticsearch - 未能在路径下找到嵌套对象

标签 elasticsearch nested

我有映射:

"mappings": {
  "productsearchmodel": {
    "properties": {
      "id": {
        "type": "integer"
      },
      "properties": {
        "properties": {
          "invariant": {
            "properties": {
              "Name": {
                "analyzer": "Replace",
                "boost": 40,
                "type": "string"
              },
              "Description": {
                "analyzer": "Replace",
                "boost": 40,
                "type": "string"
              }
            },
            "type": "nested"
          },
        },
        "type": "nested"
      }
    }
  }

我的查询是:

{
  "query": {
    "bool": {
      "should": [
        {
          "nested": {
            "path": "properties.invariant",
            "query": {
              "query_string": {
                "query": "Bal",
                "fields": [
                  "Description"
                ]
              }
            }
          }
        }
      ]
    }
  }
}

但结果是:

{
"took": 5,
"timed_out": false,
"_shards": {
"total": 2,
"successful": 1,
"failed": 1,
"failures": [
{
"index": "pagesearchmodel",
"shard": 0,
"status": 400,
"reason": "RemoteTransportException[[Powerpax][inet[/192.168.0.57:9300]][indices:data/read/search[phase/query]]]; nested: SearchParseException[[pagesearchmodel][0]: from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"bool":{"should":[{"nested":{"path":"properties.invariant","query":{"query_string":{"query":"Bal","fields":["Description"]}}}}]}}}]]]; nested: QueryParsingException[[pagesearchmodel] [nested] failed to find nested object under path [properties.invariant]]; "
}
]
},
"hits": {
"total": 0,
"max_score": null,
"hits": [ ]
}
}

最佳答案

我没有在请求网址中指定索引,并且搜索尝试在具有不同结构的所有索引上执行。

关于elasticsearch - 未能在路径下找到嵌套对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29346786/

相关文章:

elasticsearch - 使用NEST更新ElasticSearch中的子对象

elasticsearch - Elasticsearch 中的嵌套查询

javascript - 嵌套 getJSON 调用

arrays - Mongodb 使用聚合框架过滤深度嵌套数组

elasticsearch - Elasticsearch 5.2多个词的嵌套查询

excel - VBA退出内循环但返回内循环

docker - Dockerized elasticsearch和fscrawler:无法创建Elasticsearch客户端,禁用了搜寻器…连接被拒绝

elasticsearch - 无法创建有效的geo_shape

elasticsearch - 如何从弹性嵌套中排除某些值

javascript - 主干嵌套——通用架构