Skip to content

Commit

Permalink
chore(go): update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Fluf22 committed Oct 30, 2023
1 parent 0a525ff commit 42226ca
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
9 changes: 9 additions & 0 deletions website/docs/clients/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,15 @@ dependencies {

In multiplatform projects, add Algolia API client dependency to `commonMain`, and choose an [engine](https://ktor.io/docs/http-client-engines.html) for each target.

</TabItem>
<TabItem value="go">

First, install the Algolia API Go Client via the `go get` command:

```bash
go get github.com/algolia/algoliasearch-client-go/v4
```

</TabItem>
</TabsLanguage>

Expand Down
25 changes: 24 additions & 1 deletion website/docs/clients/migration-guides/go.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,28 @@ Prior to the `initIndex` removal stated in the [common breaking changes](/docs/c
That also mean you need to explicit the type you want to be returned from your queries, when it applies.

```go
// TBD
import (
"github.com/algolia/algoliasearch-client-go/v4/algolia/search"
)

indexName := "<INDEX_NAME>"
appID := "<APPLICATION_ID>"
apiKey := "<API_KEY>"

searchClient := search.NewClient(appID, apiKey)

results, err := searchClient.Search(
searchClient.NewApiSearchRequest(
search.NewSearchMethodParams(
[]search.SearchQuery{
search.SearchForHitsAsSearchQuery(
search.NewSearchForHits(
indexName,
search.WithSearchForHitsQuery("<YOUR_QUERY>"),
),
),
},
),
),
)
```

0 comments on commit 42226ca

Please sign in to comment.