Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/algolia/algoliasearch-client-go
⚡️ A fully-featured and blazing-fast Go API client to interact with Algolia.
https://github.com/algolia/algoliasearch-client-go
algolia algolia-search api-client go search
Last synced: about 1 month ago
JSON representation
⚡️ A fully-featured and blazing-fast Go API client to interact with Algolia.
- Host: GitHub
- URL: https://github.com/algolia/algoliasearch-client-go
- Owner: algolia
- License: mit
- Created: 2014-03-14T05:41:02.000Z (almost 11 years ago)
- Default Branch: main
- Last Pushed: 2024-10-29T11:34:42.000Z (about 2 months ago)
- Last Synced: 2024-10-29T13:25:16.206Z (about 1 month ago)
- Topics: algolia, algolia-search, api-client, go, search
- Language: Go
- Homepage: https://www.algolia.com/doc/api-client/go/getting-started/
- Size: 56 MB
- Stars: 200
- Watchers: 85
- Forks: 62
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
- awesome-blazingly-fast - algoliasearch-client-go - ⚡️ A fully-featured and blazing-fast Go API client to interact with Algolia. (Go)
README
The perfect starting point to integrate Algolia within your Go project
Documentation •
Community Forum •
Stack Overflow •
Report a bug •
FAQ •
Support## ✨ Features
* Support Go 1.19 and above
* Typed requests and responses
* First-class support for user-defined structures
* Injectable HTTP client## 💡 Getting Started
First, install the Algolia API Go Client via the go get command:
```bash
go get github.com/algolia/algoliasearch-client-go/v4
```You can now import the Algolia API client in your project and play with it.
```go
import "github.com/algolia/algoliasearch-client-go/v4/algolia/search"client, err := search.NewClient("YOUR_APP_ID", "YOUR_API_KEY")
// Add a new record to your Algolia index
response, err := client.SaveObject(client.NewApiSaveObjectRequest(
"", map[string]any{"objectID": "id", "test": "val"},
))
if err != nil {
// handle the eventual error
panic(err)
}// use the model directly
print(response)// Poll the task status to know when it has been indexed
taskResponse, err := searchClient.WaitForTask("", response.TaskID, nil, nil, nil)
if err != nil {
panic(err)
}// Fetch search results, with typo tolerance
response, err := client.Search(client.NewApiSearchRequest(search.NewEmptySearchMethodParams().SetRequests(
[]search.SearchQuery{*search.SearchForHitsAsSearchQuery(
search.NewEmptySearchForHits().SetIndexName("").SetQuery("").SetHitsPerPage(50))}),
))
if err != nil {
// handle the eventual error
panic(err)
}// use the model directly
print(response)
```For full documentation, visit the **[Algolia Go API Client](https://www.algolia.com/doc/libraries/go/)**.
## ❓ Troubleshooting
Encountering an issue? Before reaching out to support, we recommend heading to our [FAQ](https://www.algolia.com/doc/api-client/troubleshooting/faq/go/) where you will find answers for the most common issues and gotchas with the client. You can also open [a GitHub issue](https://github.com/algolia/api-clients-automation/issues/new?assignees=&labels=&projects=&template=Bug_report.md)
## Contributing
This repository hosts the code of the generated Algolia API client for Go, if you'd like to contribute, head over to the [main repository](https://github.com/algolia/api-clients-automation). You can also find contributing guides on [our documentation website](https://api-clients-automation.netlify.app/docs/introduction).
## 📄 License
The Algolia Go API Client is an open-sourced software licensed under the [MIT license](LICENSE).