Golang使用Elasticsearch 报错 cannot unmarshal object into Go struct field xx of type xx
Golang使用Elasticsearch 报错最近在学习用Golang使用Elasticsearch按照网上的教程本地输入和命令输入都没问题打算用网页操作,postman测试的时候报err找了半天没发现问题"err": "json: cannot unmarshal object into Go struct field SearchHits.hits.total of type int64"最
·
Golang使用Elasticsearch 报错
最近在学习用Golang使用Elasticsearch
按照网上的教程本地输入和命令输入都没问题
打算用网页操作,postman测试的时候报err
找了半天没发现问题
"err": "json: cannot unmarshal object into Go struct field SearchHits.hits.total of type int64"
最后改了版本
最开始网上找的的版本是gopkg.in/olivere/elastic.v5
但是文章有说现在是v6,我就用的gopkg.in/olivere/elastic.v6
报错之后改成"github.com/olivere/elastic/v7"就👌👌啦
更多推荐
已为社区贡献3条内容
所有评论(0)