Skip to content

Commit 355edeb

Browse files
bors[bot]meili-botbidoubiwacurquiza
authored
Merge #875
875: Changes related to the next MeiliSearch release (v0.21.0) r=bidoubiwa a=meili-bot Related to this issue: meilisearch/integration-guides#117 This PR: - gathers the changes related to the next MeiliSearch release (v0.21.0) so that this package is ready when the official release is out. - should pass the tests against the [latest pre-release of MeiliSearch](https://github.com/meilisearch/MeiliSearch/releases). Until there is an RC version, the tests should be valid against the [alpha versions of transplant](https://github.com/meilisearch/transplant/releases). - might eventually contain test failures until the MeiliSearch v0.21.0 is out. ⚠️ This PR should NOT be merged until the next release of MeiliSearch (v0.21.0) is out. _This PR is auto-generated for the [pre-release week](https://github.com/meilisearch/integration-guides/blob/master/guides/pre-release-week.md) purpose. Exceptionally for this release, the pre-release time will be more than just one week._ Co-authored-by: meili-bot <[email protected]> Co-authored-by: cvermand <[email protected]> Co-authored-by: Charlotte Vermandel <[email protected]> Co-authored-by: Clémentine Urquizar <[email protected]>
2 parents 18100a9 + ca718eb commit 355edeb

19 files changed

+1452
-1038
lines changed

.code-samples.meilisearch.yaml

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ delete_documents_1: |-
4040
search_post_1: |-
4141
client.index('movies').search('American ninja')
4242
search_get_1: |-
43-
client.index('movies').search('American ninja', {}, 'GET')
43+
client.index('movies').search('American ninja')
4444
get_update_1: |-
4545
client.index('movies').getUpdateStatus(1)
4646
get_all_updates_1: |-
@@ -52,11 +52,10 @@ get_settings_1: |-
5252
update_settings_1: |-
5353
client.index('movies').updateSettings({
5454
rankingRules: [
55-
'typo',
5655
'words',
56+
'typo',
5757
'proximity',
5858
'attribute',
59-
'wordsPosition',
6059
'exactness',
6160
'desc(release_date)',
6261
'desc(rank)'
@@ -105,11 +104,10 @@ get_ranking_rules_1: |-
105104
client.index('movies').getRankingRules()
106105
update_ranking_rules_1: |-
107106
client.index('movies').updateRankingRules([
108-
'typo',
109107
'words',
108+
'typo',
110109
'proximity',
111110
'attribute',
112-
'wordsPosition',
113111
'exactness',
114112
'asc(release_date)',
115113
'desc(rank)'
@@ -172,19 +170,19 @@ field_properties_guide_displayed_1: |-
172170
})
173171
filtering_guide_1: |-
174172
client.index('movies').search('Avengers', {
175-
filters: 'release_date > 795484800'
173+
filter: 'release_date > 795484800'
176174
})
177175
filtering_guide_2: |-
178176
client.index('movies').search('Batman', {
179-
filters: 'release_date > 795484800 AND (director = "Tim Burton" OR director = "Christopher Nolan")'
177+
filter: 'release_date > 795484800 AND (director = "Tim Burton" OR director = "Christopher Nolan")'
180178
})
181179
filtering_guide_3: |-
182180
client.index('movies').search('horror', {
183-
filters: 'director = "Jordan Peele"'
181+
filter: 'director = "Jordan Peele"'
184182
})
185183
filtering_guide_4: |-
186184
client.index('movies').search('Planet of the Apes', {
187-
filters: 'rating >= 3 AND (NOT director = "Tim Burton")'
185+
filter: 'rating >= 3 AND (NOT director = "Tim Burton")'
188186
})
189187
search_parameter_guide_query_1: |-
190188
client.index('movies').search('shifu')
@@ -206,21 +204,19 @@ search_parameter_guide_crop_1: |-
206204
cropLength: 10
207205
})
208206
search_parameter_guide_highlight_1: |-
209-
client.index('movies').search('shifu', {
207+
client.index('movies').search('winter feast', {
210208
attributesToHighlight: ['overview']
211209
})
212210
search_parameter_guide_filter_1: |-
213211
client.index('movies').search('n', {
214-
filters: 'title = Nightshift'
212+
filter: 'title = Nightshift'
215213
})
216214
search_parameter_guide_filter_2: |-
217215
client.index('movies').search('n', {
218-
filters: 'title="Kung Fu Panda"'
216+
filter: 'title="Kung Fu Panda"'
219217
})
220218
search_parameter_guide_matches_1: |-
221-
client.index('movies').search('n', {
222-
filters: 'title="Kung Fu Panda"',
223-
attributesToHighlight: ['overview'],
219+
client.index('movies').search('winter feast', {
224220
matches: true
225221
})
226222
settings_guide_synonyms_1: |-
@@ -240,11 +236,10 @@ settings_guide_stop_words_1: |-
240236
settings_guide_ranking_rules_1: |-
241237
client.index('movies').updateSettings({
242238
rankingRules: [
243-
'typo',
244239
'words',
240+
'typo',
245241
'proximity',
246242
'attribute',
247-
'wordsPosition',
248243
'exactness',
249244
'asc(release_date)',
250245
'desc(rank)'
@@ -286,7 +281,7 @@ search_guide_1: |-
286281
})
287282
search_guide_2: |-
288283
client.index('movies').search('Avengers', {
289-
filters: 'release_date > 795484800',
284+
filter: 'release_date > 795484800',
290285
})
291286
getting_started_add_documents_md: |-
292287
```bash
@@ -326,44 +321,44 @@ getting_started_search_md: |-
326321
```
327322
328323
[About this SDK](https://github.com/meilisearch/meilisearch-js/)
329-
get_attributes_for_faceting_1: |-
330-
client.index('movies').getAttributesForFaceting()
331-
update_attributes_for_faceting_1: |-
324+
get_filterable_attributes_1: |-
325+
client.index('movies').getFilterableAttributes()
326+
update_filterable_attributes_1: |-
332327
client.index('movies')
333-
.updateAttributesForFaceting([
328+
.updateFilterableAttributes([
334329
'genres',
335330
'director'
336331
])
337-
reset_attributes_for_faceting_1: |-
338-
client.index('movies').resetAttributesForFaceting()
332+
reset_filterable_attributes_1: |-
333+
client.index('movies').resetFilterableAttributes()
339334
faceted_search_update_settings_1: |-
340335
client.index('movies')
341-
.updateAttributesForFaceting([
336+
.updateFilterableAttributes([
342337
'director',
343338
'genres'
344339
])
345-
faceted_search_facet_filters_1: |-
340+
faceted_search_filter_1: |-
346341
client.index('movies')
347342
.search('thriller', {
348-
facetFilters: [['genres:Horror', 'genres:Mystery'], 'director:Jordan Peele']
343+
filter: [['genres = Horror', 'genres = Mystery'], 'director = "Jordan Peele"']
349344
})
350345
faceted_search_facets_distribution_1: |-
351346
client.index('movies')
352347
.search('Batman', {
353348
facetsDistribution: ['genres']
354349
})
355-
faceted_search_walkthrough_attributes_for_faceting_1: |-
350+
faceted_search_walkthrough_filterable_attributes_1: |-
356351
client.index('movies')
357-
.updateAttributesForFaceting([
352+
.updateFilterableAttributes([
358353
'director',
359354
'producer',
360355
'genres',
361356
'production_companies'
362357
])
363-
faceted_search_walkthrough_facet_filters_1: |-
358+
faceted_search_walkthrough_filter_1: |-
364359
client.index('movies')
365360
.search('thriller', {
366-
facetFilters: [['genres:Horror', 'genres:Mystery'], 'director:Jordan Peele']
361+
filter: [['genres = Horror', 'genres = Mystery'], 'director = "Jordan Peele"']
367362
})
368363
faceted_search_walkthrough_facets_distribution_1: |-
369364
client.index('movies')
@@ -374,3 +369,6 @@ post_dump_1: |-
374369
client.createDump()
375370
get_dump_status_1: |-
376371
client.getDumpStatus("20201101-110357260")
372+
phrase_search_1: |-
373+
client.index('movies')
374+
.search('"african american" horror')

.github/workflows/pre-release-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
16-
node: [ '10', '12', '14' ]
16+
node: [ '12', '14' ]
1717
name: integration-tests-against-rc (Node.js ${{ matrix.node }})
1818
steps:
1919
- uses: actions/checkout@v2

README.md

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ import { MeiliSearch } from 'meilisearch'
166166
})()
167167
```
168168

169-
With the `updateId`, you can check the status (`enqueued`, `processed` or `failed`) of your documents addition using the [update endpoint](https://docs.meilisearch.com/reference/api/updates.html#get-an-update-status).
169+
With the `updateId`, you can check the status (`enqueued`, `processing`, `processed` or `failed`) of your documents addition using the [update endpoint](https://docs.meilisearch.com/reference/api/updates.html#get-an-update-status).
170170

171171
#### Basic Search <!-- omit in toc -->
172172

@@ -202,9 +202,8 @@ All the supported options are described in the [search parameters](https://docs.
202202
```javascript
203203
await index.search(
204204
'wonder',
205-
{
206205
attributesToHighlight: ['*'],
207-
filters: 'id >= 1'
206+
filter: 'id >= 1'
208207
}
209208
)
210209
```
@@ -239,7 +238,7 @@ Placeholder search makes it possible to receive hits based on your parameters wi
239238
await index.search(
240239
'',
241240
{
242-
facetFilters: ['genres:fantasy'],
241+
filter: ['genres = fantasy'],
243242
facetsDistribution: ['genres']
244243
}
245244
)
@@ -266,11 +265,8 @@ await index.search(
266265
"query": "",
267266
"facetsDistribution": {
268267
"genres": {
269-
"Drama": 0,
270268
"Action": 2,
271-
"Science Fiction": 0,
272269
"Fantasy": 1,
273-
"Romance": 0,
274270
"Adventure": 1
275271
}
276272
}
@@ -284,7 +280,7 @@ You can abort a pending search request by providing an [AbortSignal](https://dev
284280
const controller = new AbortController()
285281

286282
index
287-
.search('wonder', {}, 'POST', {
283+
.search('wonder', {}, {
288284
signal: controller.signal,
289285
})
290286
.then((response) => {
@@ -299,7 +295,7 @@ controller.abort()
299295

300296
## 🤖 Compatibility with MeiliSearch
301297

302-
This package only guarantees the compatibility with the [version v0.20.0 of MeiliSearch](https://github.com/meilisearch/MeiliSearch/releases/tag/v0.20.0).
298+
This package only guarantees the compatibility with the [version v0.21.0 of MeiliSearch](https://github.com/meilisearch/MeiliSearch/releases/tag/v0.21.0).
303299

304300
## 💡 Learn More
305301

@@ -324,7 +320,11 @@ If you want to know more about the development workflow or want to contribute, p
324320

325321
- Make a search request:
326322

327-
`client.index<T>('xxx').search(query: string, options: SearchParams = {}, method: 'POST' | 'GET' = 'POST', config?: Partial<Request>): Promise<SearchResponse<T>>`
323+
`client.index<T>('xxx').search(query: string, options: SearchParams = {}, config?: Partial<Request>): Promise<SearchResponse<T>>`
324+
325+
- Make a search request using GET method (slower than the search method):
326+
327+
`client.index<T>('xxx').searchGet(query: string, options: SearchParams = {}, config?: Partial<Request>): Promise<SearchResponse<T>>`
328328

329329
### Indexes <!-- omit in toc -->
330330

@@ -443,7 +443,7 @@ Or using the index object:
443443

444444
- Update synonyms:
445445

446-
`index.updateSynonyms(synonyms: object): Promise<EnqueuedUpdate>`
446+
`index.updateSynonyms(synonyms: Synonyms): Promise<EnqueuedUpdate>`
447447

448448
- Reset synonyms:
449449

@@ -455,7 +455,7 @@ Or using the index object:
455455
`index.getStopWords(): Promise<string[]>`
456456

457457
- Update Stop Words
458-
`index.updateStopWords(string[]): Promise<EnqueuedUpdate>`
458+
`index.updateStopWords(stopWords: string[] | null ): Promise<EnqueuedUpdate>`
459459

460460
- Reset Stop Words
461461
`index.resetStopWords(): Promise<EnqueuedUpdate>`
@@ -504,6 +504,17 @@ Or using the index object:
504504
- Reset Displayed Attributes
505505
`index.resetDisplayedAttributes(): Promise<EnqueuedUpdate>`
506506

507+
### Filterable Attributes <!-- omit in toc -->
508+
509+
- Get Filterable Attributes
510+
`index.getFilterableAttributes(): Promise<string[]>`
511+
512+
- Update Filterable Attributes
513+
`index.updateFilterableAttributes(filterableAttributes: string[] | null): Promise<EnqueuedUpdate>`
514+
515+
- Reset Filterable Attributes
516+
`index.resetFilterableAttributes(): Promise<EnqueuedUpdate>`
517+
507518
### Keys <!-- omit in toc -->
508519

509520
- Get keys

playgrounds/javascript/main.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ const client = new MeiliSearch({
88
apiKey: 'masterKey',
99
})
1010

11-
async function sleep(ms) {
12-
return await new Promise((resolve) => setTimeout(resolve, ms))
13-
}
14-
1511
;(async () => {
1612
// Delete if exist
1713
try {
@@ -26,9 +22,6 @@ async function sleep(ms) {
2622
const { updateId } = await index.addDocuments(dataset)
2723
await index.waitForPendingUpdate(updateId)
2824

29-
// wait for
30-
await sleep(1000)
31-
3225
// documents
3326
const documents = await index.getDocuments()
3427

0 commit comments

Comments
 (0)