Skip to content

Commit 32b821e

Browse files
authored
Remove examples section (#102)
1 parent afc802f commit 32b821e

File tree

1 file changed

+20
-130
lines changed

1 file changed

+20
-130
lines changed

README.md

Lines changed: 20 additions & 130 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,7 @@
2929
- [🔧 Installation](#-installation)
3030
- [🚀 Getting started](#-getting-started)
3131
- [🤖 Compatibility with MeiliSearch](#-compatibility-with-meilisearch)
32-
- [🎬 Examples](#-examples)
33-
- [Client](#client)
34-
- [Indexes](#indexes)
35-
- [Documents](#documents)
36-
- [Update status](#update-status)
37-
- [Search](#search)
32+
- [📖 Documentation and Examples](#-documentation-and-examples)
3833
- [⚙️ Development Workflow and Contributing](#️-development-workflow-and-contributing)
3934

4035
## 🔧 Installation
@@ -87,7 +82,7 @@ index.add_documents(documents) # => { "updateId": 0 }
8782

8883
With the `updateId`, you can check the status (`processed` or `failed`) of your documents addition thanks to this [method](#update-status).
8984

90-
#### Search in index <!-- omit in toc -->
85+
#### Basic Search <!-- omit in toc -->
9186

9287
``` ruby
9388
# MeiliSearch is typo-tolerant:
@@ -107,131 +102,9 @@ Output:
107102
}
108103
```
109104

110-
## 🤖 Compatibility with MeiliSearch
111-
112-
This package only guarantees the compatibility with the [version v0.15.0 of MeiliSearch](https://github.com/meilisearch/MeiliSearch/releases/tag/v0.15.0).
113-
114-
## 🎬 Examples
115-
116-
All HTTP routes of MeiliSearch are accessible via methods in this SDK.</br>
117-
You can check out [the API documentation](https://docs.meilisearch.com/references/).
118-
119-
### Client
120-
121-
```ruby
122-
# Default client
123-
client = MeiliSearch::Client.new('http://127.0.0.1:7700', 'masterKey')
124-
# Custom client
125-
client = MeiliSearch::Client.new('http://127.0.0.1:7700', 'masterKey', timeout: 2, max_retries: 2)
126-
```
127-
128-
`timeout` - default value: `1` second<br>
129-
The time in seconds before a `Timeout::Error` is raised.
130-
131-
`max_retries` - default value: `0`<br>
132-
If the HTTP request times out, this number of retries will be applied.
133-
134-
### Indexes
135-
136-
#### Create an index <!-- omit in toc -->
137-
138-
```ruby
139-
# Create an index
140-
client.create_index('books')
141-
# Create an index and give the primary-key
142-
client.create_index('books', primaryKey: 'book_id')
143-
# Create an index or get the already existing one
144-
client.create_index('books')
145-
client.get_or_create_index('books', primaryKey: 'book_id')
146-
```
147-
148-
#### List all indexes <!-- omit in toc -->
149-
150-
```ruby
151-
client.indexes
152-
```
153-
154-
#### Get an index object <!-- omit in toc -->
155-
156-
```ruby
157-
client.index('books')
158-
```
159-
160-
### Documents
161-
162-
#### Fetch documents <!-- omit in toc -->
163-
164-
```ruby
165-
# Get one document
166-
index.document(123)
167-
# Get documents by batch
168-
index.documents(offset: 10 , limit: 20)
169-
```
170-
171-
#### Add documents <!-- omit in toc -->
172-
173-
```ruby
174-
index.add_documents({ book_id: 2, title: 'Madame Bovary' })
175-
```
176-
177-
Response:
178-
```json
179-
{
180-
"updateId": 1
181-
}
182-
```
183-
With this `updateId` you can track your [operation update](#update-status).
184-
185-
#### Delete documents <!-- omit in toc -->
186-
187-
```ruby
188-
# Delete one document
189-
index.delete_document(2)
190-
# Delete several documents
191-
index.delete_documents([1, 42])
192-
# Delete all documents /!\
193-
index.delete_all_documents
194-
```
195-
196-
### Update status
197-
```ruby
198-
# Get one update status
199-
# Parameter: the updateId got after an asynchronous request (e.g. documents addition)
200-
index.get_update_status(1)
201-
# Get all update satus
202-
index.get_all_update_status
203-
```
204-
205-
### Search
206-
207-
#### Basic search <!-- omit in toc -->
208-
209-
```ruby
210-
index.search('prince')
211-
```
212-
213-
```json
214-
{
215-
"hits": [
216-
{
217-
"book_id": 456,
218-
"title": "Le Petit Prince"
219-
},
220-
{
221-
"book_id": 4,
222-
"title": "Harry Potter and the Half-Blood Prince"
223-
}
224-
],
225-
"offset": 0,
226-
"limit": 20,
227-
"processingTimeMs": 13,
228-
"query": "prince"
229-
}
230-
```
231-
232105
#### Custom search <!-- omit in toc -->
233106

234-
All the supported options are described in [this documentation section](https://docs.meilisearch.com/references/search.html#search-in-an-index).
107+
All the supported options are described in [this documentation section](https://docs.meilisearch.com/guides/advanced_guides/search_parameters.html).
235108

236109
```ruby
237110
index.search('prince', { limit: 1, attributesToHighlight: '*' })
@@ -256,6 +129,23 @@ index.search('prince', { limit: 1, attributesToHighlight: '*' })
256129
}
257130
```
258131

132+
## 🤖 Compatibility with MeiliSearch
133+
134+
This package only guarantees the compatibility with the [version v0.15.0 of MeiliSearch](https://github.com/meilisearch/MeiliSearch/releases/tag/v0.15.0).
135+
136+
## 📖 Documentation and Examples
137+
138+
MeiliSearch documentation provides **examples** and a detailed explanation of every one of its features and functionalities, including examples on how to implement them **using this SDK**.
139+
140+
Please read the [guides available in the documentation](https://docs.meilisearch.com/guides/) or check the [API references](https://docs.meilisearch.com/references/) to find the one that you need!
141+
142+
The following sections may interest you:
143+
144+
- [Manipulate documents](https://docs.meilisearch.com/references/documents.html)
145+
- [Search](https://docs.meilisearch.com/references/search.html)
146+
- [Manage the indexes](https://docs.meilisearch.com/references/indexes.html)
147+
- [Configure the index settings](https://docs.meilisearch.com/references/settings.html)
148+
259149
## ⚙️ Development Workflow and Contributing
260150

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

0 commit comments

Comments
 (0)