I already have json docs as string
following code snippet is used to construct a valid json string.
func StoreInSolr(sc *solr.SolrInterface, docs []string) (*solr.SolrUpdateResponse, error) {
params := &url.Values{}
params.Add("commit", "true")
var lines []string
for _, doc := range docs {
if len(strings.TrimSpace(doc)) == 0 {
continue
}
lines = append(lines, doc)
}
data := fmt.Sprintf("[%s]\n", strings.Join(lines, ","))
fmt.Printf("data: %+v\n", data)
resp, err := sc.Update(data, params)
return resp, err
}
both resp and err indicate success:
&solr.SolrUpdateResponse{Success:true, Result:map[string]interface {}{"responseHeader":map[string]interface {}{"QTime":3, "status":0}}}, err: <nil>
but on solr debug logs i get
o.a.s.h.l.JsonLoader Can't have a value here. Unexpected STRING at [1]
This has to do with json string format but json is valid.
any pointers appreciated .
I already have json docs as string
following code snippet is used to construct a valid json string.
but on solr debug logs i get
o.a.s.h.l.JsonLoader Can't have a value here. Unexpected STRING at [1]
This has to do with json string format but json is valid.
any pointers appreciated .