Skip to content

Commit 7e095e7

Browse files
meili-bors[bot]Striftcurquiza
authored
Merge #1835
1835: Changes related to the next Meilisearch release (v1.13) r=brunoocasali a=meili-bot Related to this issue: meilisearch/integration-guides#314 This PR: - gathers the changes related to the next Meilisearch release (v1.13) 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). - might eventually contain test failures until the Meilisearch v1.13 is out. ⚠️ This PR should NOT be merged until the next release of Meilisearch (v1.13) is out. _This PR is auto-generated for the [pre-release week](https://github.com/meilisearch/integration-guides/blob/main/resources/pre-release-week.md) purpose._ Co-authored-by: Laurent Cazanove <[email protected]> Co-authored-by: Strift <[email protected]> Co-authored-by: Clémentine <[email protected]>
2 parents 1064d09 + c4a5054 commit 7e095e7

8 files changed

+36
-99
lines changed

.code-samples.meilisearch.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -821,3 +821,13 @@ get_all_batches_1: |-
821821
client.getBatches();
822822
get_batch_1: |-
823823
client.getBatch(BATCH_UID);
824+
# Vector search
825+
update_embedders_1: |-
826+
client.index('INDEX_NAME').updateEmbedders({
827+
default: {
828+
source: 'openAi',
829+
apiKey: 'OPEN_AI_API_KEY',
830+
model: 'text-embedding-3-small',
831+
documentTemplate: 'A document titled '{{doc.title}}' whose description starts with {{doc.overview|truncatewords: 20}}'
832+
}
833+
});

README.md

-2
Original file line numberDiff line numberDiff line change
@@ -1066,8 +1066,6 @@ client.index('myIndex').resetPrefixSearch(): Promise<EnqueuedTask>
10661066

10671067
### Embedders <!-- omit in toc -->
10681068

1069-
⚠️ This feature is experimental. Activate the [`vectorStore` experimental feature to use it](https://www.meilisearch.com/docs/reference/api/experimental_features#configure-experimental-features)
1070-
10711069
#### Get embedders
10721070

10731071
```ts

tests/__snapshots__/settings.test.ts.snap

+24
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ exports[`Test on settings > Admin key: Get default settings of an index 1`] = `
77
"*",
88
],
99
"distinctAttribute": null,
10+
"embedders": {},
1011
"facetSearch": true,
1112
"faceting": {
1213
"maxValuesPerFacet": 100,
@@ -57,6 +58,7 @@ exports[`Test on settings > Admin key: Get default settings of empty index with
5758
"*",
5859
],
5960
"distinctAttribute": null,
61+
"embedders": {},
6062
"facetSearch": true,
6163
"faceting": {
6264
"maxValuesPerFacet": 100,
@@ -107,6 +109,7 @@ exports[`Test on settings > Admin key: Reset embedders settings 1`] = `
107109
"*",
108110
],
109111
"distinctAttribute": null,
112+
"embedders": {},
110113
"facetSearch": true,
111114
"faceting": {
112115
"maxValuesPerFacet": 100,
@@ -157,6 +160,7 @@ exports[`Test on settings > Admin key: Reset settings 1`] = `
157160
"*",
158161
],
159162
"distinctAttribute": null,
163+
"embedders": {},
160164
"facetSearch": true,
161165
"faceting": {
162166
"maxValuesPerFacet": 100,
@@ -207,6 +211,7 @@ exports[`Test on settings > Admin key: Reset settings of empty index 1`] = `
207211
"*",
208212
],
209213
"distinctAttribute": null,
214+
"embedders": {},
210215
"facetSearch": true,
211216
"faceting": {
212217
"maxValuesPerFacet": 100,
@@ -316,6 +321,7 @@ exports[`Test on settings > Admin key: Update facetSearch settings on empty inde
316321
"*",
317322
],
318323
"distinctAttribute": null,
324+
"embedders": {},
319325
"facetSearch": false,
320326
"faceting": {
321327
"maxValuesPerFacet": 100,
@@ -366,6 +372,7 @@ exports[`Test on settings > Admin key: Update prefixSearch settings on an empty
366372
"*",
367373
],
368374
"distinctAttribute": null,
375+
"embedders": {},
369376
"facetSearch": true,
370377
"faceting": {
371378
"maxValuesPerFacet": 100,
@@ -416,6 +423,7 @@ exports[`Test on settings > Admin key: Update searchableAttributes settings on e
416423
"*",
417424
],
418425
"distinctAttribute": null,
426+
"embedders": {},
419427
"facetSearch": true,
420428
"faceting": {
421429
"maxValuesPerFacet": 100,
@@ -466,6 +474,7 @@ exports[`Test on settings > Admin key: Update searchableAttributes settings on e
466474
"*",
467475
],
468476
"distinctAttribute": null,
477+
"embedders": {},
469478
"facetSearch": true,
470479
"faceting": {
471480
"maxValuesPerFacet": 100,
@@ -519,6 +528,7 @@ exports[`Test on settings > Admin key: Update settings 1`] = `
519528
"title",
520529
],
521530
"distinctAttribute": "title",
531+
"embedders": {},
522532
"facetSearch": true,
523533
"faceting": {
524534
"maxValuesPerFacet": 50,
@@ -587,6 +597,7 @@ exports[`Test on settings > Admin key: Update settings on empty index with prima
587597
"*",
588598
],
589599
"distinctAttribute": "title",
600+
"embedders": {},
590601
"facetSearch": true,
591602
"faceting": {
592603
"maxValuesPerFacet": 100,
@@ -635,6 +646,7 @@ exports[`Test on settings > Admin key: Update settings with all null values 1`]
635646
"*",
636647
],
637648
"distinctAttribute": null,
649+
"embedders": {},
638650
"facetSearch": true,
639651
"faceting": {
640652
"maxValuesPerFacet": 100,
@@ -685,6 +697,7 @@ exports[`Test on settings > Master key: Get default settings of an index 1`] = `
685697
"*",
686698
],
687699
"distinctAttribute": null,
700+
"embedders": {},
688701
"facetSearch": true,
689702
"faceting": {
690703
"maxValuesPerFacet": 100,
@@ -735,6 +748,7 @@ exports[`Test on settings > Master key: Get default settings of empty index with
735748
"*",
736749
],
737750
"distinctAttribute": null,
751+
"embedders": {},
738752
"facetSearch": true,
739753
"faceting": {
740754
"maxValuesPerFacet": 100,
@@ -785,6 +799,7 @@ exports[`Test on settings > Master key: Reset embedders settings 1`] = `
785799
"*",
786800
],
787801
"distinctAttribute": null,
802+
"embedders": {},
788803
"facetSearch": true,
789804
"faceting": {
790805
"maxValuesPerFacet": 100,
@@ -835,6 +850,7 @@ exports[`Test on settings > Master key: Reset settings 1`] = `
835850
"*",
836851
],
837852
"distinctAttribute": null,
853+
"embedders": {},
838854
"facetSearch": true,
839855
"faceting": {
840856
"maxValuesPerFacet": 100,
@@ -885,6 +901,7 @@ exports[`Test on settings > Master key: Reset settings of empty index 1`] = `
885901
"*",
886902
],
887903
"distinctAttribute": null,
904+
"embedders": {},
888905
"facetSearch": true,
889906
"faceting": {
890907
"maxValuesPerFacet": 100,
@@ -994,6 +1011,7 @@ exports[`Test on settings > Master key: Update facetSearch settings on empty ind
9941011
"*",
9951012
],
9961013
"distinctAttribute": null,
1014+
"embedders": {},
9971015
"facetSearch": false,
9981016
"faceting": {
9991017
"maxValuesPerFacet": 100,
@@ -1044,6 +1062,7 @@ exports[`Test on settings > Master key: Update prefixSearch settings on an empty
10441062
"*",
10451063
],
10461064
"distinctAttribute": null,
1065+
"embedders": {},
10471066
"facetSearch": true,
10481067
"faceting": {
10491068
"maxValuesPerFacet": 100,
@@ -1094,6 +1113,7 @@ exports[`Test on settings > Master key: Update searchableAttributes settings on
10941113
"*",
10951114
],
10961115
"distinctAttribute": null,
1116+
"embedders": {},
10971117
"facetSearch": true,
10981118
"faceting": {
10991119
"maxValuesPerFacet": 100,
@@ -1144,6 +1164,7 @@ exports[`Test on settings > Master key: Update searchableAttributes settings on
11441164
"*",
11451165
],
11461166
"distinctAttribute": null,
1167+
"embedders": {},
11471168
"facetSearch": true,
11481169
"faceting": {
11491170
"maxValuesPerFacet": 100,
@@ -1197,6 +1218,7 @@ exports[`Test on settings > Master key: Update settings 1`] = `
11971218
"title",
11981219
],
11991220
"distinctAttribute": "title",
1221+
"embedders": {},
12001222
"facetSearch": true,
12011223
"faceting": {
12021224
"maxValuesPerFacet": 50,
@@ -1265,6 +1287,7 @@ exports[`Test on settings > Master key: Update settings on empty index with prim
12651287
"*",
12661288
],
12671289
"distinctAttribute": "title",
1290+
"embedders": {},
12681291
"facetSearch": true,
12691292
"faceting": {
12701293
"maxValuesPerFacet": 100,
@@ -1313,6 +1336,7 @@ exports[`Test on settings > Master key: Update settings with all null values 1`]
13131336
"*",
13141337
],
13151338
"distinctAttribute": null,
1339+
"embedders": {},
13161340
"facetSearch": true,
13171341
"faceting": {
13181342
"maxValuesPerFacet": 100,

tests/documents.test.ts

-18
Original file line numberDiff line numberDiff line change
@@ -226,15 +226,6 @@ Hint: It might not be working because maybe you're not up to date with the Meili
226226
const client = await getClient(permission);
227227
const adminKey = await getKey("Admin");
228228

229-
await fetch(`${HOST}/experimental-features`, {
230-
body: JSON.stringify({ vectorStore: true }),
231-
headers: {
232-
Authorization: `Bearer ${adminKey}`,
233-
"Content-Type": "application/json",
234-
},
235-
method: "PATCH",
236-
});
237-
238229
const { taskUid } = await client
239230
.index(indexPk.uid)
240231
.addDocuments(dataset);
@@ -269,15 +260,6 @@ Hint: It might not be working because maybe you're not up to date with the Meili
269260
const client = await getClient(permission);
270261
const adminKey = await getKey("Admin");
271262

272-
await fetch(`${HOST}/experimental-features`, {
273-
body: JSON.stringify({ vectorStore: true }),
274-
headers: {
275-
Authorization: `Bearer ${adminKey}`,
276-
"Content-Type": "application/json",
277-
},
278-
method: "PATCH",
279-
});
280-
281263
const { taskUid } = await client
282264
.index(indexPk.uid)
283265
.addDocuments(dataset);

tests/embedders.test.ts

+2-14
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@ import type { Embedders } from "../src/types.js";
44
import {
55
clearAllIndexes,
66
config,
7-
HOST,
87
BAD_HOST,
98
MeiliSearch,
109
getClient,
11-
getKey,
1210
} from "./utils/meilisearch-test-utils.js";
1311

1412
const index = {
@@ -58,16 +56,6 @@ describe.each([{ permission: "Master" }, { permission: "Admin" }])(
5856
beforeEach(async () => {
5957
await clearAllIndexes(config);
6058
const client = await getClient(permission);
61-
const key = await getKey(permission);
62-
63-
await fetch(`${HOST}/experimental-features`, {
64-
body: JSON.stringify({ vectorStore: true }),
65-
headers: {
66-
Authorization: `Bearer ${key}`,
67-
"Content-Type": "application/json",
68-
},
69-
method: "PATCH",
70-
});
7159

7260
const task = await client.createIndex(index.uid);
7361
await client.waitForTask(task.taskUid);
@@ -77,7 +65,7 @@ describe.each([{ permission: "Master" }, { permission: "Admin" }])(
7765
const client = await getClient(permission);
7866
const response: Embedders = await client.index(index.uid).getEmbedders();
7967

80-
expect(response).toEqual(null);
68+
expect(response).toEqual({});
8169
});
8270

8371
test(`${permission} key: Update embedders with 'userProvided' source`, async () => {
@@ -273,7 +261,7 @@ describe.each([{ permission: "Master" }, { permission: "Admin" }])(
273261

274262
const response: Embedders = await client.index(index.uid).getEmbedders();
275263

276-
expect(response).toEqual(null);
264+
expect(response).toEqual({});
277265
});
278266

279267
test(`${permission} key: search (POST) with vectors`, async () => {

tests/get_search.test.ts

-22
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import {
77
BAD_HOST,
88
MeiliSearch,
99
getClient,
10-
HOST,
11-
getKey,
1210
} from "./utils/meilisearch-test-utils.js";
1311

1412
const index = {
@@ -520,16 +518,6 @@ describe.each([
520518

521519
test(`${permission} key: search with retrieveVectors to true`, async () => {
522520
const client = await getClient(permission);
523-
const adminKey = await getKey("Admin");
524-
525-
await fetch(`${HOST}/experimental-features`, {
526-
body: JSON.stringify({ vectorStore: true }),
527-
headers: {
528-
Authorization: `Bearer ${adminKey}`,
529-
"Content-Type": "application/json",
530-
},
531-
method: "PATCH",
532-
});
533521

534522
const response = await client.index(index.uid).searchGet("prince", {
535523
retrieveVectors: true,
@@ -542,16 +530,6 @@ describe.each([
542530

543531
test(`${permission} key: search without retrieveVectors`, async () => {
544532
const client = await getClient(permission);
545-
const adminKey = await getKey("Admin");
546-
547-
await fetch(`${HOST}/experimental-features`, {
548-
body: JSON.stringify({ vectorStore: true }),
549-
headers: {
550-
Authorization: `Bearer ${adminKey}`,
551-
"Content-Type": "application/json",
552-
},
553-
method: "PATCH",
554-
});
555533

556534
const response = await client.index(index.uid).searchGet("prince");
557535

tests/search.test.ts

-21
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import {
1919
MeiliSearch,
2020
getClient,
2121
datasetWithNests,
22-
HOST,
2322
getKey,
2423
} from "./utils/meilisearch-test-utils.js";
2524

@@ -1148,16 +1147,6 @@ describe.each([
11481147

11491148
test(`${permission} key: search with retrieveVectors to true`, async () => {
11501149
const client = await getClient(permission);
1151-
const adminKey = await getKey("Admin");
1152-
1153-
await fetch(`${HOST}/experimental-features`, {
1154-
body: JSON.stringify({ vectorStore: true }),
1155-
headers: {
1156-
Authorization: `Bearer ${adminKey}`,
1157-
"Content-Type": "application/json",
1158-
},
1159-
method: "PATCH",
1160-
});
11611150

11621151
const response = await client.index(index.uid).search("prince", {
11631152
retrieveVectors: true,
@@ -1170,16 +1159,6 @@ describe.each([
11701159

11711160
test(`${permission} key: search without retrieveVectors`, async () => {
11721161
const client = await getClient(permission);
1173-
const adminKey = await getKey("Admin");
1174-
1175-
await fetch(`${HOST}/experimental-features`, {
1176-
body: JSON.stringify({ vectorStore: true }),
1177-
headers: {
1178-
Authorization: `Bearer ${adminKey}`,
1179-
"Content-Type": "application/json",
1180-
},
1181-
method: "PATCH",
1182-
});
11831162

11841163
const response = await client.index(index.uid).search("prince");
11851164

0 commit comments

Comments
 (0)