Skip to content

Commit 47dd4bb

Browse files
authored
fix(clients): update README snippets and contributing guides (#3257)
1 parent b84d736 commit 47dd4bb

File tree

12 files changed

+504
-275
lines changed

12 files changed

+504
-275
lines changed

clients/algoliasearch-client-csharp/README.md

Lines changed: 55 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -32,42 +32,78 @@
3232
* Retry strategy & Helpers.
3333

3434
**Migration note for v7.x**
35-
> In February 2024, we released v7 of our .NET client. If you are using version 6.x of the client, read the [migration guide to version 7.x](https://www.algolia.com/doc/api-client/getting-started/upgrade-guides/csharp/).
3635

37-
This version has been completely rewritten and is part of the [Api Automation initiative](https://github.com/algolia/api-clients-automation), meaning that models and routes are generated from the Algolia APIs specifications.
38-
39-
This version introduces breaking changes. A document has been created to help you migrate from v6 to v7. You can find it [here](https://api-clients-automation.netlify.app/docs/clients/migration-guides/).
36+
> In July 2024, we released v7 of our .NET client. If you are using version 6.x of the client, read the [migration guide to version 7.x](https://www.algolia.com/doc/api-client/getting-started/upgrade-guides/csharp/).
4037
4138
**Migration note from v5.x to v6.x**
42-
>
39+
4340
> In January 2019, we released v6 of our .NET client. If you are using version 5.x of the client, read the [migration guide to version 6.x](https://www.algolia.com/doc/api-client/getting-started/upgrade-guides/csharp/).
4441
Version 5.x will **no longer** be under active development.
4542

4643
## 💡 Getting Started
4744

48-
Install the library with the `.NET CLI`:
45+
To get started, first install the Algolia.Search client.
4946

50-
```sh*
51-
dotnet add package Algolia.Search
52-
```
47+
You can get the last version of the client from [NuGet](https://www.nuget.org/packages/Algolia.Search/).
5348

54-
or with the `Nuget Package Manager Console`:
49+
If you are using the .NET CLI, you can install the package using the following command:
5550

56-
```sh*
57-
Install-Package Algolia.Search
51+
```bash
52+
dotnet add package Algolia.Search --version <The version you want to install>
5853
```
5954

60-
### Documentation, Guides & API Reference
55+
Or directly in your .csproj file:
6156

62-
You will find all you need to get started in our API Client Automation [documentation](https://api-clients-automation.netlify.app/docs/clients/csharp/).
57+
```csharp
58+
<PackageReference Include="Algolia.Search" Version=${versions.csharp} />
59+
```
6360

64-
For full documentation, visit the **[Algolia .NET API Client documentation](https://www.algolia.com/doc/api-client/getting-started/install/csharp/)**.
61+
You can now import the Algolia API client in your project and play with it.
62+
63+
```csharp
64+
using Algolia.Search.Clients;
65+
using Algolia.Search.Http;
66+
67+
var client = new SearchClient(new SearchConfig("YOUR_APP_ID", "YOUR_API_KEY"));
68+
69+
// Add a new record to your Algolia index
70+
var response = await client.SaveObjectAsync(
71+
"<YOUR_INDEX_NAME>",
72+
new Dictionary<string, string> { { "objectID", "id" }, { "test", "val" } }
73+
);
74+
75+
// Poll the task status to know when it has been indexed
76+
await client.WaitForTaskAsync("<YOUR_INDEX_NAME>", response.TaskID);
77+
78+
// Fetch search results, with typo tolerance
79+
var response = await client.SearchAsync<Object>(
80+
new SearchMethodParams
81+
{
82+
Requests = new List<SearchQuery>
83+
{
84+
new SearchQuery(
85+
new SearchForHits
86+
{
87+
IndexName = "<YOUR_INDEX_NAME>",
88+
Query = "<YOUR_QUERY>",
89+
HitsPerPage = 50,
90+
}
91+
)
92+
},
93+
}
94+
);
95+
```
6596

66-
#### ASP.NET
67-
If you're using ASP.NET, checkout the [following tutorial](https://www.algolia.com/doc/api-client/getting-started/tutorials/asp.net/csharp/).
97+
For full documentation, visit the **[Algolia CSharp API Client](https://www.algolia.com/doc/api-client/getting-started/install/csharp/)**.
6898

6999
## ❓ Troubleshooting
70-
Encountering an issue? Before reaching out to support, we recommend heading to our [FAQ](https://www.algolia.com/doc/api-client/troubleshooting/faq/csharp/) where you will find answers for the most common issues and gotchas with the client.
100+
101+
Encountering an issue? Before reaching out to support, we recommend heading to our [FAQ](https://www.algolia.com/doc/api-client/troubleshooting/faq/csharp/) 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)
102+
103+
## Contributing
104+
105+
This repository hosts the code of the generated Algolia API client for CSharp, 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/contributing/introduction).
71106

72107
## 📄 License
73-
Algolia .NET API Client is an open-sourced software licensed under the [MIT license](LICENSE.md).
108+
109+
The Algolia .NET API Client is an open-sourced software licensed under the [MIT license](LICENSE).

clients/algoliasearch-client-dart/README.md

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,49 @@ flutter pub add algoliasearch
6363

6464
### Step 2: Import the Package
6565

66-
Now, you can import the `algoliasearch` package in your Dart code for all operations, including indexing, search, and personalization:
66+
You can now import the Algolia API client in your project and play with it.
6767

6868
```dart
69-
import 'package:algoliasearch/algoliasearch.dart';
69+
import 'package:algolia_client_search/algolia_client_search.dart';
70+
// Alternatively, you can import `algoliasearch_lite`, a **search-only** version of the library, if you do not need the full feature set:
71+
// import 'package:algoliasearch/algoliasearch_lite.dart';
72+
73+
final client = SearchClient(appId: 'YOUR_APP_ID', apiKey: 'YOUR_API_KEY');
74+
75+
// Add a new record to your Algolia index
76+
final response = await client.saveObject(
77+
indexName: "<YOUR_INDEX_NAME>",
78+
body: {
79+
'objectID': "id",
80+
'test': "val",
81+
},
82+
);
83+
84+
// Poll the task status to know when it has been indexed
85+
await client.waitTask('<YOUR_INDEX_NAME>', response.taskID);
86+
87+
// Fetch search results, with typo tolerance
88+
final response = await client.search(
89+
searchMethodParams: SearchMethodParams(
90+
requests: [
91+
SearchForHits(
92+
indexName: "<YOUR_INDEX_NAME>",
93+
query: "<YOUR_QUERY>",
94+
hitsPerPage: 50,
95+
),
96+
],
97+
),
98+
);
7099
```
71100

72-
Alternatively, you can import `algoliasearch_lite`, a **search-only** version of the library, if you do not need the full feature set:
101+
## ❓ Troubleshooting
73102

74-
```dart
75-
import 'package:algoliasearch/algoliasearch_lite.dart';
76-
```
103+
Encountering an issue? Before reaching out to support, we recommend heading to our [FAQ](https://www.algolia.com/doc/api-client/troubleshooting/faq/dart/) 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)
104+
105+
## Contributing
106+
107+
This repository hosts the code of the generated Algolia API client for Dart, 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/contributing/introduction).
77108

78109
## 📄 License
79110

80-
Algolia API Client is an open-sourced software licensed under the [MIT license](LICENSE).
111+
The Algolia Dart API Client is an open-sourced software licensed under the [MIT license](LICENSE).

clients/algoliasearch-client-go/README.md

Lines changed: 62 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,73 @@
2323
<a href="https://alg.li/support" target="_blank">Support</a>
2424
</p>
2525

26-
# Pre-Release Notice
27-
28-
This version of the client is currently in pre-release, which means that it is still undergoing development and testing. While we have made every effort to ensure that the software is functional and stable, there may still be bugs or issues that need to be addressed.
29-
30-
If you prefer to use the stable version of the client, please use the [latest stable version](https://pkg.go.dev/github.com/algolia/algoliasearch-client-go/v3?tab=versions).
31-
32-
3326
## ✨ Features
3427

3528
* Support Go 1.19 and above
3629
* Typed requests and responses
3730
* First-class support for user-defined structures
3831
* Injectable HTTP client
3932

40-
# Contributing to this repository
33+
## 💡 Getting Started
34+
35+
First, install the Algolia API Go Client via the go get command:
36+
37+
```bash
38+
go get github.com/algolia/algoliasearch-client-go/v4
39+
```
40+
41+
You can now import the Algolia API client in your project and play with it.
42+
43+
44+
```go
45+
import "github.com/algolia/algoliasearch-client-go/v4/algolia/search"
46+
47+
client, err := search.NewClient("YOUR_APP_ID", "YOUR_API_KEY")
48+
49+
// Add a new record to your Algolia index
50+
response, err := client.SaveObject(client.NewApiSaveObjectRequest(
51+
"<YOUR_INDEX_NAME>", map[string]any{"objectID": "id", "test": "val"},
52+
))
53+
if err != nil {
54+
// handle the eventual error
55+
panic(err)
56+
}
57+
58+
// use the model directly
59+
print(response)
60+
61+
// Poll the task status to know when it has been indexed
62+
taskResponse, err := searchClient.WaitForTask("<YOUR_INDEX_NAME>", response.TaskID, nil, nil, nil)
63+
if err != nil {
64+
panic(err)
65+
}
66+
67+
// Fetch search results, with typo tolerance
68+
response, err := client.Search(client.NewApiSearchRequest(
69+
70+
search.NewEmptySearchMethodParams().SetRequests(
71+
[]search.SearchQuery{*search.SearchForHitsAsSearchQuery(
72+
search.NewEmptySearchForHits().SetIndexName("<YOUR_INDEX_NAME>").SetQuery("<YOUR_QUERY>").SetHitsPerPage(50))}),
73+
))
74+
if err != nil {
75+
// handle the eventual error
76+
panic(err)
77+
}
78+
79+
// use the model directly
80+
print(response)
81+
```
82+
83+
For full documentation, visit the **[Algolia Go API Client](https://www.algolia.com/doc/api-client/getting-started/install/go/)**.
84+
85+
## ❓ Troubleshooting
86+
87+
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)
88+
89+
## Contributing
90+
91+
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/contributing/introduction).
92+
93+
## 📄 License
4194

42-
The Algolia API clients are automatically generated, you can find everything here https://github.com/algolia/api-clients-automation
95+
The Algolia Go API Client is an open-sourced software licensed under the [MIT license](LICENSE).

clients/algoliasearch-client-java/README.md

Lines changed: 33 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -27,101 +27,63 @@
2727
* Thread-safe clients
2828
* Typed requests and responses
2929

30-
**Migration note from v2.x to v3.x**
30+
**Migration note from v3.x to v4.x**
3131
>
32-
> In June 2019, we released v3 of our Java client. If you are using version 2.x of the client, read the [migration guide to version 3.x](https://www.algolia.com/doc/api-client/getting-started/upgrade-guides/java/).
33-
Version 2.x will **no longer** be under active development.
32+
> In July 2024, we released the v4 of our Java client. If you are using version 2.x or 3.x of the client, read the [migration guide to version 4.x](https://www.algolia.com/doc/api-client/getting-started/upgrade-guides/java/).
33+
Version 3.x will **no longer** be under active development.
3434

3535
## 💡 Getting Started
3636

37-
### Install
38-
39-
* **Maven**: add the following to your `pom.xml` file:
40-
41-
```xml
42-
<dependency>
43-
<groupId>com.algolia</groupId>
44-
<artifactId>algoliasearch</artifactId>
45-
<version>LATEST</version>
46-
</dependency>
47-
```
48-
* **Gradle**: add the following to your `build.gradle` file:
49-
```groovy
50-
implementation "com.algolia:algoliasearch:$version"
51-
```
52-
53-
### Initialize the client
54-
55-
To start, you need to initialize the client. To do this, you need your **Application ID** and **API Key**.
56-
You can find both on [your Algolia account](https://www.algolia.com/api-keys).
57-
58-
```java
59-
SearchClient client = new SearchClient("MY_APPLICATION_ID", "MY_API_KEY");
60-
```
61-
62-
If you need to customize the configuration of the client, use
63-
`ClientOptions` when instantiating the Algolia `SearchClient` instance.
37+
To get started, add the algoliasearch-client-java dependency to your project, either with [Maven](Maven):
6438

6539
```java
66-
ClientOptions options = ClientOptions.builder().setLogLevel(LogLevel.BODY).build();
67-
SearchClient client = new SearchClient("MY_APPLICATION_ID", "MY_API_KEY", options);
40+
<dependency>
41+
<groupId>com.algolia</groupId>
42+
<artifactId>algoliasearch</artifactId>
43+
<version>4.0.0-beta.36</version>
44+
</dependency>
6845
```
6946

70-
### Push data
71-
72-
Without any prior configuration, you can start indexing contacts in the `contacts` index using the following code:
47+
or [Gradle](https://gradle.org/):
7348

7449
```java
75-
class Contact {
76-
private String firstname;
77-
private String lastname;
78-
private int followers;
79-
private String company;
80-
private String objectID;
81-
// Getters/setters ommitted
50+
dependencies {
51+
implementation 'com.algolia:algoliasearch:4.0.0-beta.36'
8252
}
83-
84-
Contact contact = new Contact()
85-
.setObjectID("one")
86-
.setFirstname("Jimmie")
87-
.setLastname("Barninger")
88-
.setFollowers(93)
89-
.setCompany("California Paint");
90-
91-
List<Contact> records = Arrays.asList(contact);
92-
List<BatchRequest> batch = records.stream()
93-
.map(entry -> new BatchRequest().setAction(Action.ADD_OBJECT).setBody(entry))
94-
.toList();
95-
BatchResponse response = client.batch("contacts", new BatchWriteParams().setRequests(batch));
9653
```
9754

98-
### Search
99-
100-
You can now search for contacts by `firstname`, `lastname`, `company`, etc. (even with typos):
55+
You can now import the Algolia API client in your project and play with it.
10156

10257
```java
103-
SearchParams params = SearchParams.of(new SearchParamsObject().setQuery("jimmie"));
58+
import com.algolia.api.SearchClient;
59+
import com.algolia.model.search.*;
10460

105-
// Synchronous search
106-
client.searchSingleIndex("contacts", params, Contact.class);
61+
SearchClient client = new SearchClient("YOUR_APP_ID", "YOUR_API_KEY");
10762

108-
// Asynchronous search
109-
client.searchSingleIndexAsync("contacts", params, Contact.class);
110-
```
63+
// Add a new record to your Algolia index
64+
client.saveObject("<YOUR_INDEX_NAME>", Map.of("objectID", "id", "test", "val"));
11165

112-
For full documentation, visit the [Algolia Java API Client's documentation](https://www.algolia.com/doc/api-client/getting-started/install/java/).
66+
// Poll the task status to know when it has been indexed
67+
client.waitForTask("<YOUR_INDEX_NAME>", response.getTaskID());
11368

114-
## 📝 Examples
69+
// Fetch search results, with typo tolerance
70+
client.search(
71+
new SearchMethodParams()
72+
.setRequests(List.of(new SearchForHits().setIndexName("<YOUR_INDEX_NAME>").setQuery("<YOUR_QUERY>").setHitsPerPage(50))),
73+
Hit.class
74+
);
75+
```
11576

116-
You can find code samples in the [Algolia's API Clients playground](https://github.com/algolia/api-clients-playground/tree/master/java/src/main/java).
77+
For full documentation, visit the **[Algolia Java API Client](https://www.algolia.com/doc/api-client/getting-started/install/java/)**.
11778

11879
## ❓ Troubleshooting
11980

120-
Encountering an issue? Before reaching out to support, we recommend heading to our [FAQ](https://www.algolia.com/doc/api-client/troubleshooting/faq/java/) where you will find answers for the most common issues and gotchas with the client.
81+
Encountering an issue? Before reaching out to support, we recommend heading to our [FAQ](https://www.algolia.com/doc/api-client/troubleshooting/faq/java/) 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)
12182

122-
## Use the Dockerfile
83+
## Contributing
12384

124-
If you want to contribute to this project without installing all its dependencies, you can use our Docker image. Please check our [dedicated guide](DOCKER_README.MD) to learn more.
85+
This repository hosts the code of the generated Algolia API client for Java, 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/contributing/introduction).
12586

12687
## 📄 License
127-
Algolia Java API Client is an open-sourced software licensed under the [MIT license](LICENSE).
88+
89+
The Algolia Java API Client is an open-sourced software licensed under the [MIT license](LICENSE).

0 commit comments

Comments
 (0)