Skip to content

Commit e7b2e96

Browse files
committed
Readme update
1 parent 734b4fe commit e7b2e96

File tree

1 file changed

+85
-40
lines changed

1 file changed

+85
-40
lines changed

README.md

Lines changed: 85 additions & 40 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,75 +19,120 @@
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 a client for **MeiliSearch** written in Java. **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
37+
## 📖 Documentation
3938

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).
43-
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
52+
import com.meilisearch.sdk.Client;
5653
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 indexUid = "books";
61+
final String documents = "["
62+
+ "{\"book_id\": 123, \"title\": \"Pride and Prejudice\"},"
63+
+ "{\"book_id\": 456, \"title\": \"Le Petit Prince\"},"
64+
+ "{\"book_id\": 1, \"title\": \"Alice In Wonderland\"},"
65+
+ "{\"book_id\": 1344, \"title\": \"The Hobbit\"},"
66+
+ "{\"book_id\": 4, \"title\": \"Harry Potter and the Half-Blood Prince\"},"
67+
+ "{\"book_id\": 2, \"title\": \"The Hitchhiker\'s Guide to the Galaxy\"}"
68+
+ "]";
69+
70+
Client client = new Client(new Config("http://localhost:7700", "masterKey"));
71+
Index index = client.createIndex(indexUid);
72+
73+
index.addDocuments(documents);
74+
}
75+
76+
}
77+
```
78+
79+
#### Basic Search <!-- omit in toc -->
80+
81+
```java
82+
5783
import com.meilisearch.sdk.Client;
84+
import com.meilisearch.sdk.Config;
85+
import com.meilisearch.sdk.Index;
86+
87+
public class Main {
88+
89+
public static void main(String[] args) throws Exception {
90+
91+
final String indexUid = "books";
92+
93+
Client client = new Client(new Config("http://localhost:7700", "masterKey"));
94+
Index index = client.getIndex(indexUid);
95+
96+
// MeiliSearch is typo-tolerant:
97+
String results = index.search("harry pottre", 10);
98+
System.out.println(results);
99+
}
58100

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-
}
79101
}
80102
```
81103

104+
Output:
105+
```json
106+
{
107+
"hits": [{
108+
"book_id": 4,
109+
"title": "Harry Potter and the Half-Blood Prince"
110+
}],
111+
"offset": 0,
112+
"limit": 20,
113+
"nbHits": 1,
114+
"exhaustiveNbHits": false,
115+
"processingTimeMs": 2,
116+
"query": "harry pottre"
117+
}
118+
```
119+
120+
#### Custom Search <!-- omit in toc -->
121+
122+
// TODO:
123+
82124
## 🤖 Compatibility with MeiliSearch
83125

84-
This package is compatible with the following MeiliSearch versions:
85-
- `v0.14.X`
86-
- `v0.13.X`
126+
This package only guarantees the compatibility with the [version v0.15.0 of MeiliSearch](https://github.com/meilisearch/MeiliSearch/releases/tag/v0.15.0).
87127

88-
## 🎬 Examples
128+
## 💡 Learn More
89129

90-
// TODO:
130+
The following sections may interest you:
131+
132+
- **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).
133+
- **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).
134+
- **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).
135+
- **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).
91136

92137
## ⚙️ Development Workflow and Contributing
93138

0 commit comments

Comments
 (0)