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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?