Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes related to the next Meilisearch release (v1.13) #1835

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1040,8 +1040,6 @@ client.index('myIndex').resetPrefixSearch(): Promise<EnqueuedTask>

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

⚠️ 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
Expand Down
24 changes: 24 additions & 0 deletions tests/__snapshots__/settings.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -107,6 +109,7 @@ exports[`Test on settings > Admin key: Reset embedders settings 1`] = `
"*",
],
"distinctAttribute": null,
"embedders": {},
"facetSearch": true,
"faceting": {
"maxValuesPerFacet": 100,
Expand Down Expand Up @@ -157,6 +160,7 @@ exports[`Test on settings > Admin key: Reset settings 1`] = `
"*",
],
"distinctAttribute": null,
"embedders": {},
"facetSearch": true,
"faceting": {
"maxValuesPerFacet": 100,
Expand Down Expand Up @@ -207,6 +211,7 @@ exports[`Test on settings > Admin key: Reset settings of empty index 1`] = `
"*",
],
"distinctAttribute": null,
"embedders": {},
"facetSearch": true,
"faceting": {
"maxValuesPerFacet": 100,
Expand Down Expand Up @@ -316,6 +321,7 @@ exports[`Test on settings > Admin key: Update facetSearch settings on empty inde
"*",
],
"distinctAttribute": null,
"embedders": {},
"facetSearch": false,
"faceting": {
"maxValuesPerFacet": 100,
Expand Down Expand Up @@ -366,6 +372,7 @@ exports[`Test on settings > Admin key: Update prefixSearch settings on an empty
"*",
],
"distinctAttribute": null,
"embedders": {},
"facetSearch": true,
"faceting": {
"maxValuesPerFacet": 100,
Expand Down Expand Up @@ -416,6 +423,7 @@ exports[`Test on settings > Admin key: Update searchableAttributes settings on e
"*",
],
"distinctAttribute": null,
"embedders": {},
"facetSearch": true,
"faceting": {
"maxValuesPerFacet": 100,
Expand Down Expand Up @@ -466,6 +474,7 @@ exports[`Test on settings > Admin key: Update searchableAttributes settings on e
"*",
],
"distinctAttribute": null,
"embedders": {},
"facetSearch": true,
"faceting": {
"maxValuesPerFacet": 100,
Expand Down Expand Up @@ -519,6 +528,7 @@ exports[`Test on settings > Admin key: Update settings 1`] = `
"title",
],
"distinctAttribute": "title",
"embedders": {},
"facetSearch": true,
"faceting": {
"maxValuesPerFacet": 50,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -785,6 +799,7 @@ exports[`Test on settings > Master key: Reset embedders settings 1`] = `
"*",
],
"distinctAttribute": null,
"embedders": {},
"facetSearch": true,
"faceting": {
"maxValuesPerFacet": 100,
Expand Down Expand Up @@ -835,6 +850,7 @@ exports[`Test on settings > Master key: Reset settings 1`] = `
"*",
],
"distinctAttribute": null,
"embedders": {},
"facetSearch": true,
"faceting": {
"maxValuesPerFacet": 100,
Expand Down Expand Up @@ -885,6 +901,7 @@ exports[`Test on settings > Master key: Reset settings of empty index 1`] = `
"*",
],
"distinctAttribute": null,
"embedders": {},
"facetSearch": true,
"faceting": {
"maxValuesPerFacet": 100,
Expand Down Expand Up @@ -994,6 +1011,7 @@ exports[`Test on settings > Master key: Update facetSearch settings on empty ind
"*",
],
"distinctAttribute": null,
"embedders": {},
"facetSearch": false,
"faceting": {
"maxValuesPerFacet": 100,
Expand Down Expand Up @@ -1044,6 +1062,7 @@ exports[`Test on settings > Master key: Update prefixSearch settings on an empty
"*",
],
"distinctAttribute": null,
"embedders": {},
"facetSearch": true,
"faceting": {
"maxValuesPerFacet": 100,
Expand Down Expand Up @@ -1094,6 +1113,7 @@ exports[`Test on settings > Master key: Update searchableAttributes settings on
"*",
],
"distinctAttribute": null,
"embedders": {},
"facetSearch": true,
"faceting": {
"maxValuesPerFacet": 100,
Expand Down Expand Up @@ -1144,6 +1164,7 @@ exports[`Test on settings > Master key: Update searchableAttributes settings on
"*",
],
"distinctAttribute": null,
"embedders": {},
"facetSearch": true,
"faceting": {
"maxValuesPerFacet": 100,
Expand Down Expand Up @@ -1197,6 +1218,7 @@ exports[`Test on settings > Master key: Update settings 1`] = `
"title",
],
"distinctAttribute": "title",
"embedders": {},
"facetSearch": true,
"faceting": {
"maxValuesPerFacet": 50,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
18 changes: 0 additions & 18 deletions tests/documents.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
16 changes: 2 additions & 14 deletions tests/embedders.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@
import {
clearAllIndexes,
config,
HOST,
BAD_HOST,
MeiliSearch,
getClient,
getKey,
} from "./utils/meilisearch-test-utils.js";

const index = {
Expand Down Expand Up @@ -58,16 +56,6 @@
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);
Expand All @@ -77,7 +65,7 @@
const client = await getClient(permission);
const response: Embedders = await client.index(index.uid).getEmbedders();

expect(response).toEqual(null);
expect(response).toEqual({});

Check failure on line 68 in tests/embedders.test.ts

View workflow job for this annotation

GitHub Actions / integration-tests (Node.js 18)

tests/embedders.test.ts > Test on embedders > Master key: Get default embedders

AssertionError: expected null to deeply equal {} - Expected: Object {} + Received: null ❯ tests/embedders.test.ts:68:24

Check failure on line 68 in tests/embedders.test.ts

View workflow job for this annotation

GitHub Actions / integration-tests (Node.js 20)

tests/embedders.test.ts > Test on embedders > Master key: Get default embedders

AssertionError: expected null to deeply equal {} - Expected: Object {} + Received: null ❯ tests/embedders.test.ts:68:24

Check failure on line 68 in tests/embedders.test.ts

View workflow job for this annotation

GitHub Actions / integration-tests (Node.js 22)

tests/embedders.test.ts > Test on embedders > Master key: Get default embedders

AssertionError: expected null to deeply equal {} - Expected: Object {} + Received: null ❯ tests/embedders.test.ts:68:24
});

test(`${permission} key: Update embedders with 'userProvided' source`, async () => {
Expand Down Expand Up @@ -273,7 +261,7 @@

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

expect(response).toEqual(null);
expect(response).toEqual({});

Check failure on line 264 in tests/embedders.test.ts

View workflow job for this annotation

GitHub Actions / integration-tests (Node.js 18)

tests/embedders.test.ts > Test on embedders > Master key: Reset embedders

AssertionError: expected null to deeply equal {} - Expected: Object {} + Received: null ❯ tests/embedders.test.ts:264:24

Check failure on line 264 in tests/embedders.test.ts

View workflow job for this annotation

GitHub Actions / integration-tests (Node.js 20)

tests/embedders.test.ts > Test on embedders > Master key: Reset embedders

AssertionError: expected null to deeply equal {} - Expected: Object {} + Received: null ❯ tests/embedders.test.ts:264:24

Check failure on line 264 in tests/embedders.test.ts

View workflow job for this annotation

GitHub Actions / integration-tests (Node.js 22)

tests/embedders.test.ts > Test on embedders > Master key: Reset embedders

AssertionError: expected null to deeply equal {} - Expected: Object {} + Received: null ❯ tests/embedders.test.ts:264:24
});

test(`${permission} key: search (POST) with vectors`, async () => {
Expand Down
22 changes: 0 additions & 22 deletions tests/get_search.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import {
BAD_HOST,
MeiliSearch,
getClient,
HOST,
getKey,
} from "./utils/meilisearch-test-utils.js";

const index = {
Expand Down Expand Up @@ -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,
Expand All @@ -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");

Expand Down
21 changes: 0 additions & 21 deletions tests/search.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {
MeiliSearch,
getClient,
datasetWithNests,
HOST,
getKey,
} from "./utils/meilisearch-test-utils.js";

Expand Down Expand Up @@ -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,
Expand All @@ -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");

Expand Down
Loading
Loading