Skip to content

Commit 54d25f8

Browse files
authored
Readme update (#43)
* Update README.md
1 parent e1bba35 commit 54d25f8

File tree

1 file changed

+69
-41
lines changed

1 file changed

+69
-41
lines changed

README.md

Lines changed: 69 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66

77
<h4 align="center">
88
<a href="https://github.com/meilisearch/MeiliSearch">MeiliSearch</a> |
9+
<a href="https://docs.meilisearch.com">Documentation</a> |
910
<a href="https://www.meilisearch.com">Website</a> |
1011
<a href="https://blog.meilisearch.com">Blog</a> |
1112
<a href="https://twitter.com/meilisearch">Twitter</a> |
12-
<a href="https://docs.meilisearch.com">Documentation</a> |
1313
<a href="https://docs.meilisearch.com/faq">FAQ</a>
1414
</h4>
1515

@@ -19,76 +19,104 @@
1919
<a href="https://github.com/meilisearch/MeiliSearch/discussions" alt="Discussions"><img src="https://img.shields.io/badge/github-discussions-red" /></a>
2020
</p>
2121

22-
<p align="center">
23-
⚡ Lightning Fast, Ultra Relevant, and Typo-Tolerant Search Engine MeiliSearch client written in Java
24-
</p>
22+
<p align="center">⚡ The MeiliSearch API client written for Java</p>
2523

26-
<hr>
24+
**MeiliSearch Java** is the MeiliSearch API client for Java developers. **MeiliSearch** is a powerful, fast, open-source, easy to use and deploy search engine. Both searching and indexing are highly customizable. Features such as typo-tolerance, filters, facets and synonyms are provided out-of-the-box.
2725

2826
### ⚠️ Important!: this is WIP, and not available for production ⚠️
2927

3028
## Table of Contents <!-- omit in toc -->
3129

30+
- [📖 Documentation](#-documentation)
3231
- [🔧 Installation](#-installation)
33-
- [🚀 Getting started](#-getting-started)
32+
- [🚀 Getting Started](#-getting-started)
3433
- [🤖 Compatibility with MeiliSearch](#-compatibility-with-meilisearch)
35-
- [🎬 Examples](#-examples)
34+
- [💡 Learn More](#-learn-more)
3635
- [⚙️ Development Workflow and Contributing](#️-development-workflow-and-contributing)
3736

38-
# meilisearch-java
39-
40-
Java client for MeiliSearch.
41-
42-
MeiliSearch provides an ultra relevant and instant full-text search. Our solution is open-source and you can check out [our repository here](https://github.com/meilisearch/MeiliSearch).
37+
## 📖 Documentation
4338

44-
Here is the [MeiliSearch documentation](https://docs.meilisearch.com/) 📖
39+
See our [Documentation](https://docs.meilisearch.com/guides/introduction/quick_start_guide.html) or our [API References](https://docs.meilisearch.com/references/).
4540

4641

4742
## 🔧 Installation
4843

4944
// TODO:
5045

5146

52-
## 🚀 Getting started
47+
## 🚀 Getting Started
48+
49+
#### Add documents <!-- omit in toc -->
5350

54-
#### Quickstart
5551
```java
56-
import com.meilisearch.sdk.Config;
5752
import com.meilisearch.sdk.Client;
53+
import com.meilisearch.sdk.Config;
54+
import com.meilisearch.sdk.Index;
55+
56+
public class Main {
57+
58+
public static void main(String[] args) throws Exception {
59+
60+
final String documents = "["
61+
+ "{\"book_id\": 123, \"title\": \"Pride and Prejudice\"},"
62+
+ "{\"book_id\": 456, \"title\": \"Le Petit Prince\"},"
63+
+ "{\"book_id\": 1, \"title\": \"Alice In Wonderland\"},"
64+
+ "{\"book_id\": 1344, \"title\": \"The Hobbit\"},"
65+
+ "{\"book_id\": 4, \"title\": \"Harry Potter and the Half-Blood Prince\"},"
66+
+ "{\"book_id\": 2, \"title\": \"The Hitchhiker\'s Guide to the Galaxy\"}"
67+
+ "]";
68+
69+
Client client = new Client(new Config("http://localhost:7700", "masterKey"));
70+
Index index = client.createIndex("books"); // If your index does not exist
71+
Index index = client.getIndex("books"); // If you already created your index
72+
73+
index.addDocuments(documents);
74+
}
5875

59-
public class TestApp {
60-
61-
public static void main(String[] args) throws Exception {
62-
Client ms = new Client(new Config("http://localhost:7700", ""));
63-
64-
// create new Index with primary key(optional)
65-
ms.createIndex("books", "books_id");
66-
67-
Indexes book = ms.getIndex("books");
68-
69-
JsonArray jsonArray = new JsonArray();
70-
JsonObject jsonObject = new JsonObject();
71-
jsonObject.addProperty("1111", "alice in wonderland");
72-
jsonArray.add(jsonObject);
73-
74-
// add new document "[{"1111": "alice in wonderland"}]"
75-
String response = book.addDocuments(jsonObject.toString());
76-
77-
// response : "{ "updateId": 0 }"
78-
}
7976
}
8077
```
8178

82-
## 🤖 Compatibility with MeiliSearch
79+
#### Basic Search <!-- omit in toc -->
8380

84-
This package is compatible with the following MeiliSearch versions:
85-
- `v0.14.X`
86-
- `v0.13.X`
81+
```java
82+
// MeiliSearch is typo-tolerant:
83+
String results = index.search("harry pottre");
84+
System.out.println(results);
85+
```
86+
87+
Output:
88+
```json
89+
{
90+
"hits": [{
91+
"book_id": 4,
92+
"title": "Harry Potter and the Half-Blood Prince"
93+
}],
94+
"offset": 0,
95+
"limit": 20,
96+
"nbHits": 1,
97+
"exhaustiveNbHits": false,
98+
"processingTimeMs": 2,
99+
"query": "harry pottre"
100+
}
101+
```
87102

88-
## 🎬 Examples
103+
#### Custom Search <!-- omit in toc -->
89104

90105
// TODO:
91106

107+
## 🤖 Compatibility with MeiliSearch
108+
109+
This package only guarantees the compatibility with the [version v0.15.0 of MeiliSearch](https://github.com/meilisearch/MeiliSearch/releases/tag/v0.15.0).
110+
111+
## 💡 Learn More
112+
113+
The following sections may interest you:
114+
115+
- **Manipulate documents**: see the [API references](https://docs.meilisearch.com/references/documents.html) or read more about [documents](https://docs.meilisearch.com/guides/main_concepts/documents.html).
116+
- **Search**: see the [API references](https://docs.meilisearch.com/references/search.html) or follow our guide on [search parameters](https://docs.meilisearch.com/guides/advanced_guides/search_parameters.html).
117+
- **Manage the indexes**: see the [API references](https://docs.meilisearch.com/references/indexes.html) or read more about [indexes](https://docs.meilisearch.com/guides/main_concepts/indexes.html).
118+
- **Configure the index settings**: see the [API references](https://docs.meilisearch.com/references/settings.html) or follow our guide on [settings parameters](https://docs.meilisearch.com/guides/advanced_guides/settings.html).
119+
92120
## ⚙️ Development Workflow and Contributing
93121

94122
Any new contribution is more than welcome in this project!

0 commit comments

Comments
 (0)