From 0086473480e23935038c729b91046e87dcb59e3a Mon Sep 17 00:00:00 2001 From: Laurent Cazanove Date: Thu, 30 Jan 2025 13:19:18 +0800 Subject: [PATCH] Remove `vectorStore` experimental setting (#1846) * Update README * Remove manual enabling * Update expected response * Update snapshots * Lint --- README.md | 2 -- tests/__snapshots__/settings.test.ts.snap | 24 +++++++++++++++++++++++ tests/documents.test.ts | 18 ----------------- tests/embedders.test.ts | 16 ++------------- tests/get_search.test.ts | 22 --------------------- tests/search.test.ts | 21 -------------------- tests/settings.test.ts | 22 --------------------- 7 files changed, 26 insertions(+), 99 deletions(-) diff --git a/README.md b/README.md index 2a37f1642..cb75f01a4 100644 --- a/README.md +++ b/README.md @@ -1038,8 +1038,6 @@ client.index('myIndex').resetPrefixSearch(): Promise ### Embedders -⚠️ This feature is experimental. Activate the [`vectorStore` experimental feature to use it](https://www.meilisearch.com/docs/reference/api/experimental_features#configure-experimental-features) - #### Get embedders ```ts diff --git a/tests/__snapshots__/settings.test.ts.snap b/tests/__snapshots__/settings.test.ts.snap index 675589d42..13fdfc93c 100644 --- a/tests/__snapshots__/settings.test.ts.snap +++ b/tests/__snapshots__/settings.test.ts.snap @@ -7,6 +7,7 @@ exports[`Test on settings > Admin key: Get default settings of an index 1`] = ` "*", ], "distinctAttribute": null, + "embedders": {}, "facetSearch": true, "faceting": { "maxValuesPerFacet": 100, @@ -57,6 +58,7 @@ exports[`Test on settings > Admin key: Get default settings of empty index with "*", ], "distinctAttribute": null, + "embedders": {}, "facetSearch": true, "faceting": { "maxValuesPerFacet": 100, @@ -107,6 +109,7 @@ exports[`Test on settings > Admin key: Reset embedders settings 1`] = ` "*", ], "distinctAttribute": null, + "embedders": {}, "facetSearch": true, "faceting": { "maxValuesPerFacet": 100, @@ -157,6 +160,7 @@ exports[`Test on settings > Admin key: Reset settings 1`] = ` "*", ], "distinctAttribute": null, + "embedders": {}, "facetSearch": true, "faceting": { "maxValuesPerFacet": 100, @@ -207,6 +211,7 @@ exports[`Test on settings > Admin key: Reset settings of empty index 1`] = ` "*", ], "distinctAttribute": null, + "embedders": {}, "facetSearch": true, "faceting": { "maxValuesPerFacet": 100, @@ -316,6 +321,7 @@ exports[`Test on settings > Admin key: Update facetSearch settings on empty inde "*", ], "distinctAttribute": null, + "embedders": {}, "facetSearch": false, "faceting": { "maxValuesPerFacet": 100, @@ -366,6 +372,7 @@ exports[`Test on settings > Admin key: Update prefixSearch settings on an empty "*", ], "distinctAttribute": null, + "embedders": {}, "facetSearch": true, "faceting": { "maxValuesPerFacet": 100, @@ -416,6 +423,7 @@ exports[`Test on settings > Admin key: Update searchableAttributes settings on e "*", ], "distinctAttribute": null, + "embedders": {}, "facetSearch": true, "faceting": { "maxValuesPerFacet": 100, @@ -466,6 +474,7 @@ exports[`Test on settings > Admin key: Update searchableAttributes settings on e "*", ], "distinctAttribute": null, + "embedders": {}, "facetSearch": true, "faceting": { "maxValuesPerFacet": 100, @@ -519,6 +528,7 @@ exports[`Test on settings > Admin key: Update settings 1`] = ` "title", ], "distinctAttribute": "title", + "embedders": {}, "facetSearch": true, "faceting": { "maxValuesPerFacet": 50, @@ -587,6 +597,7 @@ exports[`Test on settings > Admin key: Update settings on empty index with prima "*", ], "distinctAttribute": "title", + "embedders": {}, "facetSearch": true, "faceting": { "maxValuesPerFacet": 100, @@ -635,6 +646,7 @@ exports[`Test on settings > Admin key: Update settings with all null values 1`] "*", ], "distinctAttribute": null, + "embedders": {}, "facetSearch": true, "faceting": { "maxValuesPerFacet": 100, @@ -685,6 +697,7 @@ exports[`Test on settings > Master key: Get default settings of an index 1`] = ` "*", ], "distinctAttribute": null, + "embedders": {}, "facetSearch": true, "faceting": { "maxValuesPerFacet": 100, @@ -735,6 +748,7 @@ exports[`Test on settings > Master key: Get default settings of empty index with "*", ], "distinctAttribute": null, + "embedders": {}, "facetSearch": true, "faceting": { "maxValuesPerFacet": 100, @@ -785,6 +799,7 @@ exports[`Test on settings > Master key: Reset embedders settings 1`] = ` "*", ], "distinctAttribute": null, + "embedders": {}, "facetSearch": true, "faceting": { "maxValuesPerFacet": 100, @@ -835,6 +850,7 @@ exports[`Test on settings > Master key: Reset settings 1`] = ` "*", ], "distinctAttribute": null, + "embedders": {}, "facetSearch": true, "faceting": { "maxValuesPerFacet": 100, @@ -885,6 +901,7 @@ exports[`Test on settings > Master key: Reset settings of empty index 1`] = ` "*", ], "distinctAttribute": null, + "embedders": {}, "facetSearch": true, "faceting": { "maxValuesPerFacet": 100, @@ -994,6 +1011,7 @@ exports[`Test on settings > Master key: Update facetSearch settings on empty ind "*", ], "distinctAttribute": null, + "embedders": {}, "facetSearch": false, "faceting": { "maxValuesPerFacet": 100, @@ -1044,6 +1062,7 @@ exports[`Test on settings > Master key: Update prefixSearch settings on an empty "*", ], "distinctAttribute": null, + "embedders": {}, "facetSearch": true, "faceting": { "maxValuesPerFacet": 100, @@ -1094,6 +1113,7 @@ exports[`Test on settings > Master key: Update searchableAttributes settings on "*", ], "distinctAttribute": null, + "embedders": {}, "facetSearch": true, "faceting": { "maxValuesPerFacet": 100, @@ -1144,6 +1164,7 @@ exports[`Test on settings > Master key: Update searchableAttributes settings on "*", ], "distinctAttribute": null, + "embedders": {}, "facetSearch": true, "faceting": { "maxValuesPerFacet": 100, @@ -1197,6 +1218,7 @@ exports[`Test on settings > Master key: Update settings 1`] = ` "title", ], "distinctAttribute": "title", + "embedders": {}, "facetSearch": true, "faceting": { "maxValuesPerFacet": 50, @@ -1265,6 +1287,7 @@ exports[`Test on settings > Master key: Update settings on empty index with prim "*", ], "distinctAttribute": "title", + "embedders": {}, "facetSearch": true, "faceting": { "maxValuesPerFacet": 100, @@ -1313,6 +1336,7 @@ exports[`Test on settings > Master key: Update settings with all null values 1`] "*", ], "distinctAttribute": null, + "embedders": {}, "facetSearch": true, "faceting": { "maxValuesPerFacet": 100, diff --git a/tests/documents.test.ts b/tests/documents.test.ts index 996f9bc92..5a738ca6a 100644 --- a/tests/documents.test.ts +++ b/tests/documents.test.ts @@ -226,15 +226,6 @@ Hint: It might not be working because maybe you're not up to date with the Meili const client = await getClient(permission); const adminKey = await getKey("Admin"); - await fetch(`${HOST}/experimental-features`, { - body: JSON.stringify({ vectorStore: true }), - headers: { - Authorization: `Bearer ${adminKey}`, - "Content-Type": "application/json", - }, - method: "PATCH", - }); - const { taskUid } = await client .index(indexPk.uid) .addDocuments(dataset); @@ -269,15 +260,6 @@ Hint: It might not be working because maybe you're not up to date with the Meili const client = await getClient(permission); const adminKey = await getKey("Admin"); - await fetch(`${HOST}/experimental-features`, { - body: JSON.stringify({ vectorStore: true }), - headers: { - Authorization: `Bearer ${adminKey}`, - "Content-Type": "application/json", - }, - method: "PATCH", - }); - const { taskUid } = await client .index(indexPk.uid) .addDocuments(dataset); diff --git a/tests/embedders.test.ts b/tests/embedders.test.ts index 0b980c1c8..13ac89140 100644 --- a/tests/embedders.test.ts +++ b/tests/embedders.test.ts @@ -4,11 +4,9 @@ import type { Embedders } from "../src/types.js"; import { clearAllIndexes, config, - HOST, BAD_HOST, MeiliSearch, getClient, - getKey, } from "./utils/meilisearch-test-utils.js"; const index = { @@ -58,16 +56,6 @@ describe.each([{ permission: "Master" }, { permission: "Admin" }])( beforeEach(async () => { await clearAllIndexes(config); const client = await getClient(permission); - const key = await getKey(permission); - - await fetch(`${HOST}/experimental-features`, { - body: JSON.stringify({ vectorStore: true }), - headers: { - Authorization: `Bearer ${key}`, - "Content-Type": "application/json", - }, - method: "PATCH", - }); const task = await client.createIndex(index.uid); await client.waitForTask(task.taskUid); @@ -77,7 +65,7 @@ describe.each([{ permission: "Master" }, { permission: "Admin" }])( const client = await getClient(permission); const response: Embedders = await client.index(index.uid).getEmbedders(); - expect(response).toEqual(null); + expect(response).toEqual({}); }); test(`${permission} key: Update embedders with 'userProvided' source`, async () => { @@ -273,7 +261,7 @@ describe.each([{ permission: "Master" }, { permission: "Admin" }])( const response: Embedders = await client.index(index.uid).getEmbedders(); - expect(response).toEqual(null); + expect(response).toEqual({}); }); test(`${permission} key: search (POST) with vectors`, async () => { diff --git a/tests/get_search.test.ts b/tests/get_search.test.ts index 158fe971b..fd9243a34 100644 --- a/tests/get_search.test.ts +++ b/tests/get_search.test.ts @@ -7,8 +7,6 @@ import { BAD_HOST, MeiliSearch, getClient, - HOST, - getKey, } from "./utils/meilisearch-test-utils.js"; const index = { @@ -520,16 +518,6 @@ describe.each([ test(`${permission} key: search with retrieveVectors to true`, async () => { const client = await getClient(permission); - const adminKey = await getKey("Admin"); - - await fetch(`${HOST}/experimental-features`, { - body: JSON.stringify({ vectorStore: true }), - headers: { - Authorization: `Bearer ${adminKey}`, - "Content-Type": "application/json", - }, - method: "PATCH", - }); const response = await client.index(index.uid).searchGet("prince", { retrieveVectors: true, @@ -542,16 +530,6 @@ describe.each([ test(`${permission} key: search without retrieveVectors`, async () => { const client = await getClient(permission); - const adminKey = await getKey("Admin"); - - await fetch(`${HOST}/experimental-features`, { - body: JSON.stringify({ vectorStore: true }), - headers: { - Authorization: `Bearer ${adminKey}`, - "Content-Type": "application/json", - }, - method: "PATCH", - }); const response = await client.index(index.uid).searchGet("prince"); diff --git a/tests/search.test.ts b/tests/search.test.ts index c51c84956..3e9e0bd72 100644 --- a/tests/search.test.ts +++ b/tests/search.test.ts @@ -19,7 +19,6 @@ import { MeiliSearch, getClient, datasetWithNests, - HOST, getKey, } from "./utils/meilisearch-test-utils.js"; @@ -1148,16 +1147,6 @@ describe.each([ test(`${permission} key: search with retrieveVectors to true`, async () => { const client = await getClient(permission); - const adminKey = await getKey("Admin"); - - await fetch(`${HOST}/experimental-features`, { - body: JSON.stringify({ vectorStore: true }), - headers: { - Authorization: `Bearer ${adminKey}`, - "Content-Type": "application/json", - }, - method: "PATCH", - }); const response = await client.index(index.uid).search("prince", { retrieveVectors: true, @@ -1170,16 +1159,6 @@ describe.each([ test(`${permission} key: search without retrieveVectors`, async () => { const client = await getClient(permission); - const adminKey = await getKey("Admin"); - - await fetch(`${HOST}/experimental-features`, { - body: JSON.stringify({ vectorStore: true }), - headers: { - Authorization: `Bearer ${adminKey}`, - "Content-Type": "application/json", - }, - method: "PATCH", - }); const response = await client.index(index.uid).search("prince"); diff --git a/tests/settings.test.ts b/tests/settings.test.ts index b090f72c4..2296f4ced 100644 --- a/tests/settings.test.ts +++ b/tests/settings.test.ts @@ -7,8 +7,6 @@ import { MeiliSearch, getClient, dataset, - getKey, - HOST, } from "./utils/meilisearch-test-utils.js"; const index = { @@ -151,16 +149,6 @@ describe.each([{ permission: "Master" }, { permission: "Admin" }])( test(`${permission} key: Update embedders settings `, async () => { const client = await getClient(permission); - const key = await getKey(permission); - - await fetch(`${HOST}/experimental-features`, { - body: JSON.stringify({ vectorStore: true }), - headers: { - Authorization: `Bearer ${key}`, - "Content-Type": "application/json", - }, - method: "PATCH", - }); const newSettings: Settings = { embedders: { @@ -219,16 +207,6 @@ describe.each([{ permission: "Master" }, { permission: "Admin" }])( test(`${permission} key: Reset embedders settings `, async () => { const client = await getClient(permission); - const key = await getKey(permission); - - await fetch(`${HOST}/experimental-features`, { - body: JSON.stringify({ vectorStore: true }), - headers: { - Authorization: `Bearer ${key}`, - "Content-Type": "application/json", - }, - method: "PATCH", - }); const newSettings: Settings = { embedders: null,