MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / NewTypesenseClient

Function NewTypesenseClient

internal/search/search.go:161–171  ·  view source on GitHub ↗

NewTypesenseClient initializes and returns a new Typesense client instance.

(apiKey string, hosts []string)

Source from the content-addressed store, hash-verified

159
160// NewTypesenseClient initializes and returns a new Typesense client instance.
161func NewTypesenseClient(apiKey string, hosts []string) *TypesenseClient {
162 client := typesense.NewClient(
163 typesense.WithServer(hosts[0]),
164 typesense.WithAPIKey(apiKey),
165 typesense.WithConnectionTimeout(5*time.Second),
166 typesense.WithCircuitBreakerMaxRequests(50),
167 typesense.WithCircuitBreakerInterval(2*time.Minute),
168 typesense.WithCircuitBreakerTimeout(1*time.Minute),
169 )
170 return &TypesenseClient{Client: client}
171}
172
173// EnsureCollectionsExist ensures that all the necessary collections exist in the Typesense schema.
174// If a collection doesn't exist, it will create the collection based on the latest schema.

Callers 4

NewLedgerForgeFunction · 0.92
initializeTypeSenseFunction · 0.92
indexDataMethod · 0.92
indexBatchDataMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected