We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
es, err := elasticsearch.NewTypedClient(elasticsearch.Config{ Addresses: []string{"http://127.0.0.1:9200"}, Username: "es", Password: "123456", }) if err != nil { golog.Error("Error creating elasticsearch:" + err.Error()) return } document := struct { Name string `json:"name"` }{ "go-elasticsearch", } b, _ := json.Marshal(document) str := string(b) golog.Debug("doc:" + str) res, err := es.Create("index1", "doc_id6").Document(str).Refresh(refresh.True).Do(context.Background()) if err != nil { golog.Error("es.Create error :" + err.Error()) return } golog.WithTag("elasticsearch").Info(res)
running error is : status: 400, failed: [mapper_parsing_exception], reason: failed to parse Document func not surport json string? only go struct ? why ? thanks gays.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
running error is : status: 400, failed: [mapper_parsing_exception], reason: failed to parse
Document func not surport json string? only go struct ? why ? thanks gays.
The text was updated successfully, but these errors were encountered: