Golr aims to provide you a fully accessibility to Apache Solr from Go.
go get github.com/shinpei/golr
import (
"github.com/shinpei/golr"
"runtime"
"fmt"
)
func main () {
con, _ := golr.Connect("localhost", 8983)
title := "example"
textBody := "this is an example"
d := []Page{{
Id: "uniqueKey",
Title: title,
Text: textBody,
TextCount: len(textBody),
},
}
opt := &golr.SolrAddOption{
Concurrency: runtime.NumCPU(),
}
msg := <-con.AddDocuments(d, opt)
fmt.Println(string(msg[:]))
}
It's under ASL2.0. If you find bug or improvement request, please contact me through twitter, @shinpeintk. And always welcoming heartful pull request.
Cheers, 🍺 🗿