我相信我正在遵循以下步驟: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 客戶端時,您會收到類似的錯誤消息。
- 1 回答
- 0 關注
- 173 瀏覽
添加回答
舉報
0/150
提交
取消
