You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// If the index 'books' does not exist, MeiliSearch creates it when you first add the documents.
146
+
// If the index 'movies' does not exist, MeiliSearch creates it when you first add the documents.
147
147
let response =awaitindex.addDocuments(documents)
148
148
149
149
console.log(response) // => { "updateId": 0 }
@@ -156,7 +156,7 @@ With the `updateId`, you can check the status (`enqueued`, `processed` or `faile
156
156
157
157
```javascript
158
158
// MeiliSearch is typo-tolerant:
159
-
constsearch=awaitindex.search('harry pottre')
159
+
constsearch=awaitindex.search('philoudelphia')
160
160
console.log(search)
161
161
```
162
162
@@ -166,17 +166,16 @@ Output:
166
166
{
167
167
"hits": [
168
168
{
169
-
"book_id": 4,
170
-
"title": "Harry Potter and the Half-Blood Prince",
171
-
"genres": ["fantasy"]
169
+
"id": "6",
170
+
"title": "Philadelphia",
171
+
"genres": ["Drama"]
172
172
}
173
173
],
174
174
"offset": 0,
175
175
"limit": 20,
176
176
"nbHits": 1,
177
-
"exhaustiveNbHits": false,
178
177
"processingTimeMs": 1,
179
-
"query": "harry pottre"
178
+
"query": "philoudelphia"
180
179
}
181
180
```
182
181
@@ -186,10 +185,10 @@ All the supported options are described in the [search parameters](https://docs.
186
185
187
186
```javascript
188
187
awaitindex.search(
189
-
'prince',
188
+
'wonder',
190
189
{
191
190
attributesToHighlight: ['*'],
192
-
filters:'book_id > 10'
191
+
filters:'id >= 1'
193
192
}
194
193
)
195
194
```
@@ -198,28 +197,27 @@ await index.search(
198
197
{
199
198
"hits": [
200
199
{
201
-
"book_id": 456,
202
-
"title": "Le Petit Prince",
203
-
"genres": ["poetic"],
200
+
"id": 2,
201
+
"title": "Wonder Woman",
202
+
"genres": ["Action", "Adventure"],
204
203
"_formatted": {
205
-
"book_id": 456,
206
-
"title": "Le Petit <em>Prince</em>",
207
-
"genres": ["poetic"]
204
+
"id": 2,
205
+
"title": "<em>Wonder</em> Woman",
206
+
"genres": ["Action", "Adventure"]
208
207
}
209
208
}
210
209
],
211
210
"offset": 0,
212
211
"limit": 20,
213
212
"nbHits": 1,
214
-
"exhaustiveNbHits": false,
215
213
"processingTimeMs": 0,
216
-
"query": "prince"
214
+
"query": "wonder"
217
215
}
218
216
```
219
217
220
218
#### Placeholder Search <!-- omit in toc -->
221
219
222
-
Placeholder search makes it possible to receive hits based on your parameters without having any query (`q`).
220
+
Placeholder search makes it possible to receive hits based on your parameters without having any query (`q`). To enable faceted search on your dataset you need to add `genres` in the [settings](https://docs.meilisearch.com/reference/features/faceted_search.html#setting-up-facets).
223
221
224
222
```javascript
225
223
awaitindex.search(
@@ -235,25 +233,31 @@ await index.search(
235
233
{
236
234
"hits": [
237
235
{
238
-
"id": 4,
239
-
"title": "Harry Potter and the Half-Blood Prince",
0 commit comments