猫鼠 [mapper_parsing_exception] 没有在字段 [type] 上声明的类型 [字符串] 的处理程



这是错误

{ Error: [mapper_parsing_exception] No handler for type [string] declared on field [type]
    at respond (/home/jilu/Documents/project/backup/assignment_ok/node_modules/elasticsearch/src/lib/transport.js:289:15)
    at checkRespForFailure (/home/jilu/Documents/project/backup/assignment_ok/node_modules/elasticsearch/src/lib/transport.js:248:7)
    at HttpConnector.<anonymous> (/home/jilu/Documents/project/backup/assignment_ok/node_modules/elasticsearch/src/lib/connectors/http.js:164:7)
    at IncomingMessage.wrapper (/home/jilu/Documents/project/backup/assignment_ok/node_modules/elasticsearch/node_modules/lodash/lodash.js:4968:19)
    at emitNone (events.js:91:20)
    at IncomingMessage.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:974:12)
    at _combinedTickCallback (internal/process/next_tick.js:80:11)
    at process._tickCallback (internal/process/next_tick.js:104:9)
  status: 400,
  displayName: 'BadRequest',
  message: '[mapper_parsing_exception] No handler for type [string] declared on field [type]',

映射不是创建

请解释猫鼬的配置。

我正在使用Express JS和MongoDb作为后端。

在 if 呼叫搜索 API 之后,我得到:

{
    "took": 1,
    "timed_out": false,
    "_shards": {
        "total": 5,
        "successful": 5,
        "skipped": 0,
        "failed": 0
    },
    "hits": {
        "total": 0,
        "max_score": null,
        "hits": []
    }
}

命中数组为空,总数为零,映射也显示为空。

我在设置 Mongoosastic

4.3 + Elasticsearch 6.2 后遇到了同样的问题,这个问题是由于 Mongoosastic 与 Elasticsearch 6.x 不兼容!!

如果你用谷歌搜索,你会发现Elasticsearch将默认类型从"字符串"更改为"文本",并记录在这里。在帖子的末尾,他们说:

也就是说,您仍然应该考虑升级它们,因为我们计划在发布 Elasticsearch 6.0 时删除此向后兼容层。

我在Mongoosastic上发现了更多与最新Elasticsearch 6.2的不兼容性。 我已经提交了一个拉取请求来进行这些更改,但不确定何时/是否会被接受。在他们修复正式版本之前,我正在使用我的 Mongoosastic 克隆进行修复,直到他们修补官方存储库。

最新更新