Hanzo Search Go SDK
Go client library for Hanzo Search (Meilisearch compatible). Fork of `meilisearch/meilisearch-go` with module path rewritten to `github.com/hanzoai/search-go`. The Go package name is `meilisearch`....
Overview
Go client library for Hanzo Search (Meilisearch compatible). Fork of meilisearch/meilisearch-go with module path rewritten to github.com/hanzoai/search-go. The Go package name is meilisearch. Provides index management, document CRUD, search with filters/facets/highlighting, settings management, task monitoring, chat, and webhook support.
OSS Base
Fork of meilisearch-go (meilisearch/meilisearch-go). Repo: hanzoai/search-go, branch: main.
Quick reference
| Item | Value |
|---|---|
| Module | github.com/hanzoai/search-go |
| Package | meilisearch |
| Version | 0.36.1 |
| Go | 1.26+ |
| Repo | github.com/hanzoai/search-go |
| Branch | main |
| License | MIT |
| Protocol | HTTP/REST |
Installation
go get github.com/hanzoai/search-goQuick start
package main
import (
"fmt"
search "github.com/hanzoai/search-go"
)
func main() {
client := search.New("http://localhost:7700", search.WithAPIKey("your-api-key"))
// Create index
task, _ := client.CreateIndex(&search.IndexConfig{
Uid: "movies",
PrimaryKey: "id",
})
fmt.Println("Task:", task.TaskUID)
// Add documents
index := client.Index("movies")
docs := []map[string]interface{}{
{"id": 1, "title": "Carol", "genres": []string{"Romance", "Drama"}},
{"id": 2, "title": "Wonder Woman", "genres": []string{"Action"}},
}
task, _ = index.AddDocuments(docs, nil)
// Search
res, _ := index.Search("wonder", &search.SearchRequest{Limit: 10})
fmt.Println(res.Hits)
}Key features
- Index creation, listing, updating, deletion
- Document add, update, delete (batch and single)
- Full-text search with filters, facets, highlighting, sorting
- Settings management (filterable, sortable, searchable attributes)
- Multi-search across multiple indexes
- Facet search
- Task management (async operations)
- Chat interface (streaming)
- Webhook support
- Content encoding (gzip, deflate, brotli)
- Configurable retries with backoff
- JWT-based tenant tokens
Client options
client := search.New("http://localhost:7700",
search.WithAPIKey("your-api-key"),
search.WithCustomClient(http.DefaultClient),
search.WithContentEncoding(search.GzipEncoding, search.BestCompression),
search.WithCustomRetries([]int{502, 503, 504}, 3),
)| Option | Description |
|---|---|
WithAPIKey | API key for authentication |
WithCustomClient | Custom http.Client |
WithCustomClientWithTLS | Enable TLS |
WithContentEncoding | Request/response encoding |
WithCustomRetries | Retry by status code and max retries |
DisableRetries | Disable automatic retries |
Build and test
go build ./...
go test ./...
# Integration tests require a running Meilisearch instanceHow is this guide?
Last updated on
Hanzo Storage
Hanzo Storage is a high-performance, S3-compatible object storage server for AI workloads. Fork of MinIO. This is a full server binary, not a client library. Any S3-compatible SDK (aws-sdk-go, boto...
Hanzo Sentry - Error Tracking & Performance Monitoring
Hanzo Sentry is a self-hosted Sentry 24.2.0 deployment for error tracking and performance monitoring across all Hanzo, Lux, Zoo, and Pars services. It is a fork of getsentry/sentry with a custom Do...