亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Golang Elasticsearch Olivere:根映射定義具有不受支持的參數

Golang Elasticsearch Olivere:根映射定義具有不受支持的參數

Go
慕容708150 2023-08-14 14:32:41
我相信我正在遵循以下步驟:client, err := elastic.NewClient()if err != nil {? ? // Handle error? ? panic(err)}// Create a new index.mapping := `{? ? "settings":{? ? ? ? "number_of_shards":1,? ? ? ? "number_of_replicas":0? ? },? ? "mappings":{? ? ? ? "properties":{? ? ? ? ? ? "tags":{? ? ? ? ? ? ? ? "type":"keyword"? ? ? ? ? ? },? ? ? ? ? ? "location":{? ? ? ? ? ? ? ? "type":"geo_point"? ? ? ? ? ? },? ? ? ? ? ? "suggest_field":{? ? ? ? ? ? ? ? "type":"completion",? ? ? ? ? ? ? ? "payloads":true? ? ? ? ? ? }? ? ? ? }? ? }}`ctx := context.Background()createIndex, err := client.CreateIndex("twitter").BodyString(mapping).Do(ctx)if err != nil {? ? // Handle error? ? panic(err)}if !createIndex.Acknowledged {? ? // Not acknowledged}但我收到一個錯誤:Failed to parse mapping [properties]: Root mapping definition has unsupported parameters: [location : {type=geo_point}] [suggest_field : {payloads=true, type=completion}] [tags : {type=keyword}] [type=mapper_parsing_exception]我知道Elasticsearch V7 中已刪除映射類型,但不知道這會如何產生上述錯誤。我也在相應的倉庫中報告了這個問題。
查看完整描述

1 回答

?
大話西游666

TA貢獻1817條經驗 獲得超14個贊

原因是

"payloads": true

刪除“payloads”:true后,它可以工作。

請注意,當您在 Elastic V6 上運行但意外使用 V7 的 golang 客戶端時,您會收到類似的錯誤消息。


查看完整回答
反對 回復 2023-08-14
  • 1 回答
  • 0 關注
  • 173 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號