gpt4 book ai didi

mongodb - mongoosastic [mapper_parsing_exception] 没有在字段 [type] 上声明的类型 [string] 的处理程序

转载 作者:行者123 更新时间:2023-12-03 00:02:12 24 4
gpt4 key购买 nike

这是错误

{ 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]',

并且映射没有创建

请解释一下mongoosastic的配置。

我使用 express JS 和 MongoDb 作为后端。

在 if 调用 search Api 之后,我得到:
{
"took": 1,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 0,
"max_score": null,
"hits": []
}
}

Hits 数组为空,总计为零,映射也显示为空。

最佳答案

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

如果你用谷歌搜索,你会发现 Elasticsearch 将默认类型从“字符串”更改为“文本”,并记录了 here。 .在帖子的最后,他们说:

That said, you should still look into upgrading them since we plan on removing this backward compatibility layer when we release Elasticsearch 6.0.



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

关于mongodb - mongoosastic [mapper_parsing_exception] 没有在字段 [type] 上声明的类型 [string] 的处理程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48126274/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com