Sep 20, 2024
Query Suggestions API client
This client is new in v4 of the Go API clients.
The Query Suggestions API client is part of the algoliasearch-client-go
package.
To install it, run:
Copy
1
go get github.com/algolia/algoliasearch-client-go
To use the Query Suggestions client, add this import to your files:
Copy
1
import suggestions "github.com/algolia/algoliasearch-client-go/v4/algolia/query-suggestions"
To create an instance of the client:
Copy
1
2
3
4
5
client, err := suggestions.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY", suggestions.US)
if err != nil {
// The client can fail to initialize if you pass an invalid parameter.
panic(err)
}
Make sure to use the region that matches your Algolia application’s analytics region:
suggestions.US
for the United States or suggestions.EU
for Europe.
You can check your analytics region in the Infrastructure > Analytics section of the Algolia dashboard.
List of methods
Each method makes one request to the Query Suggestions API.
Configurations
client.GetAllConfigs | List configurations |
client.CreateConfig | Create a configuration |
client.GetConfig | Retrieve a configuration |
client.UpdateConfig | Update a configuration |
client.DeleteConfig | Delete a configuration |
client.GetConfigStatus | Retrieve configuration status |
Logs
client.GetLogFile | Retrieve logs |
Did you find this page helpful?