go-solr

solr go client from sendgrid, zookeeper aware, incorporates retries

Github星跟踪图

SendGrid Logo

travis
Go Report Card
GoDoc
MIT licensed
CLA assistant
GitHub contributors

go-solr

solr go client from Sendgrid

Usage

To start the client

solrzk := solr.NewSolrZK(...)
solrzk.Listen()
solrhttp := solr.NewSolrHttp(solrzk)
solrClient := solr.NewSolrHttpRetrier(solrhttp)

The Read and Update methods take a node list use the SolrLocator interface to return a node list

locator := solr.GetSolrLocator(solr.NewSolrZK(...))
type SolrLocator interface {
	GetLeaders(docID string) ([]string, error)
	GetReplicaUris() ([]string, error)
	GetReplicasFromRoute(route string) ([]string, error)
	GetLeadersAndReplicas(docID string) ([]string, error)
}

To make requests

solrClient.Select(locator.GetReplicasFromRoute("shard!"),solr.FilterQuery("myfield:test"),solr.Route("shardkey!"))

To make updates

solrClient.Update(locator.GetLeadersAndReplicas("{anydocidtoroute}"),collectionName,callsSolrJsonDocs, docsMap)

Tests on solr

  1. docker-compose up
  2. docker-compose run gotests bash
  3. go test
  4. go run ./cmd/solrRunner.go 1000

Tests with cluster of 3 solrs

  1. docker-compose -p cluster -f docker-compose.cluster.yml up
  2. docker-compose -p cluster run gotests bash
  3. go test
  4. go run ./cmd/solrRunner.go 1000

License

The MIT License (MIT)

主要指标

概览
名称与所有者statedecoded/statedecoded
主编程语言PHP
编程语言Go (语言数: 10)
平台
许可证Other
所有者活动
创建于2011-06-12 03:28:21
推送于2021-05-12 00:14:49
最后一次提交2017-04-24 12:01:05
发布数11
最新版本名称1.0 (发布于 )
第一版名称v0.1 (发布于 2012-05-31 16:29:02)
用户参与
星数256
关注者数30
派生数54
提交数1.8k
已启用问题?
问题数638
打开的问题数85
拉请求数85
打开的拉请求数4
关闭的拉请求数8
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?