go-solr

module
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2020 License: MIT

README

go-solr

Build Status GoDoc Go Walker

Solr v4, required v4.4 if you want use all supported features.

Json only

No schema checking

Please go to http://wiki.apache.org/solr/ for how to write solr query.

Features

Search, Add, Update, Delete, Commit, Rollback, Optimize

Core admin, Schema REST API

Install

go get github.com/vanng822/go-solr/solr

Usage

package main
import (
	"github.com/vanng822/go-solr/solr"
	"fmt"
)

func main() {
  si, _ := solr.NewSolrInterface("http://localhost:8983/solr", "collection1")
  query := solr.NewQuery()
  query.Q("*:*")
  s := si.Search(query)
  r, _ := s.Result(nil)
  fmt.Println(r.Results.Docs)
}

Developers

export MOCK_LOGGING=1

for the mock logging

unset MOCK_LOGGING

to remove this environment variable

License

MIT

Directories

Path Synopsis
examples
Solr client in Go, core admin, add docs, update, delete, search and more package main import ( "github.com/vanng822/go-solr/solr" "fmt" ) func main() { si, _ := solr.NewSolrInterface("http://localhost:8983/solr", "collection1") query := solr.NewQuery() query.Q("*:*") s := si.Search(query) r, _ := s.Result(nil) fmt.Println(r.Results.Docs) }
Solr client in Go, core admin, add docs, update, delete, search and more package main import ( "github.com/vanng822/go-solr/solr" "fmt" ) func main() { si, _ := solr.NewSolrInterface("http://localhost:8983/solr", "collection1") query := solr.NewQuery() query.Q("*:*") s := si.Search(query) r, _ := s.Result(nil) fmt.Println(r.Results.Docs) }

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL