ElasticSearch-[嵌套]无法在路径下找到嵌套对象

时间:2018-11-05 16:32:02

标签: elasticsearch

我的ElasticSearch查询有问题。 我正在尝试在某个特定日期出发,并确认已经出发。

这是我模板的一部分:

"mappings" : {
    "properties" : {
      "dates_depart" : {
        "type" : "nested",
        "properties": {
          "date_depart": {"type": "date"
          },
          "last_minute": {
            "type": "integer"
          },
          "depart_confirm": {
            "type": "integer"
          }
        }
      },
    }
}

这是我的查询:

"query": { "nested" : { "path" : "dates_depart", "query" : { "bool" : { "must" : [ { "match" : {"dates_depart.depart_confirme" : 1}}, { "range" : {"dates_departs.date_depart" : {"gte":"07\/11\/2018","lte":"15\/11\/2018","format":"dd\/MM\/yyyy"}} }]}}}}

但是我的查询返回的不是8个结果:

"caused_by":{"type":"illegal_state_exception","reason":"[nested] nested object under path [dates_depart] is not of nested type"}}},"status":400}

我该如何解决?

1 个答案:

答案 0 :(得分:-1)

瘦...未考虑模板的最新版本... 我只是更正了。

不幸的是,现在我有一个新的错误。当然与我的索引相关

{"error":{"root_cause":[{"type":"json_e_o_f_exception","reason":"Unexpected end-of-input: expected close marker for Object (start marker at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@67a98c0c; line: 1, column: 1])\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@67a98c0c; line: 1, column: 533]"}],"type":"json_e_o_f_exception","reason":"Unexpected end-of-input: expected close marker for Object (start marker at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@67a98c0c; line: 1, column: 1])\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@67a98c0c; line: 1, column: 533]"},"status":500}