Skip to content

Commit 6fd293a

Browse files
authored
add: installation instructions
1 parent 11be8c1 commit 6fd293a

File tree

1 file changed

+26
-7
lines changed

1 file changed

+26
-7
lines changed

README.md

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,38 @@
11
# Typesense Java Client ☕ 🔍
22

3-
Java client for the Typesense API: https://github.com/typesense/typesense
3+
Java client library for accessing the HTTP API of [Typesense](https://typesense.org) search engine.
4+
5+
Note: This package is still under development. Some existing APIs might change or new APIs might be available in the future.
6+
7+
## Installation
8+
9+
Download the JAR file from the [releases](https://github.com/typesense/typesense-java/releases) section of this repository and add it to your project.
10+
11+
```java
12+
import org.typesense.api.*;
13+
import org.typesense.models.*;
14+
import org.typesense.resources.*;
15+
```
416

517
## Usage
618

719
### Create a new client
820
```java
921
ArrayList<Node> nodes = new ArrayList<>();
10-
nodes.add(new Node("http","localhost","3001"));
11-
Configuration configuration = new Configuration(nodes, Duration.ofSeconds(3),"xyz");
12-
Client client = client = new Client(configuration);
22+
nodes.add(
23+
new Node(
24+
"http", // For Typesense Cloud use https
25+
"localhost", // For Typesense Cloud use xxx.a1.typesense.net
26+
"8108" // For Typesense Cloud use 443
27+
)
28+
);
29+
30+
Configuration configuration = new Configuration(nodes, Duration.ofSeconds(2),"<API_KEY>");
31+
32+
Clienr client = new Client(configuration);
1333
```
1434

15-
### Create a collection
35+
### Create a new collection
1636
```java
1737
ArrayList<Field> fields = new ArrayList<>();
1838
fields.add(new Field().name("countryName").type("string"));
@@ -258,12 +278,11 @@ client.operations.perform("vote");
258278
client.health.retrieve();
259279
```
260280
## Contributing
261-
Bug reports and pull requests are welcome on GitHub at https://github.com/typesense/typesense-java.
262281

263282
Please read [CONTRIBUTING.md](https://github.com/typesense/typesense-java/blob/master/CONTRIBUTING.md) for details on the process for submitting pull requests to this repository.
264283

265284
## License
266285
`typesense-java` is distributed under the Apache 2 license.
267286

268287
## Support
269-
Please open a Github issue or join our [Slack Community](https://join.slack.com/t/typesense-community/shared_invite/zt-mx4nbsbn-AuOL89O7iBtvkz136egSJg)
288+
Please open a Github issue or join our [Slack Community](https://join.slack.com/t/typesense-community/shared_invite/zt-mx4nbsbn-AuOL89O7iBtvkz136egSJg)

0 commit comments

Comments
 (0)