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.7.0) #1631

Merged
merged 7 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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: 2 additions & 0 deletions src/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ export type OpenAiEmbedder = {
model?: string
apiKey?: string
documentTemplate?: string
dimensions?: number
}

export type HuggingFaceEmbedder = {
Expand All @@ -346,6 +347,7 @@ export type UserProvidedEmbedder = {
source: 'userProvided'
dimensions: number
}

export type Embedder =
| OpenAiEmbedder
| HuggingFaceEmbedder
Expand Down
3 changes: 2 additions & 1 deletion tests/embedders.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,10 @@ describe.each([{ permission: 'Master' }, { permission: 'Admin' }])(
default: {
source: 'openAi',
apiKey: '<your-OpenAI-API-key>',
model: 'text-embedding-ada-002',
model: 'text-embedding-3-small',
documentTemplate:
"A movie titled '{{doc.title}}' whose description starts with {{doc.overview|truncatewords: 20}}",
dimensions: 1536,
},
}
const task: EnqueuedTask = await client
Expand Down
12 changes: 1 addition & 11 deletions tests/search.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,18 +271,8 @@ describe.each([
expect(hit).toHaveProperty('_rankingScore')
})

test(`${permission} key: search with showRankingScoreDetails enabled`, async () => {
test(`${permission} key: search with showRankingScoreDetails`, async () => {
const client = await getClient(permission)
const key = await getKey(permission)

await fetch(`${HOST}/experimental-features`, {
body: JSON.stringify({ scoreDetails: true }),
headers: {
Authorization: `Bearer ${key}`,
'Content-Type': 'application/json',
},
method: 'PATCH',
})

const response = await client.index(index.uid).search('prince', {
showRankingScoreDetails: true,
Expand Down
Loading