Skip to content

Commit

Permalink
Merge pull request #1631 from meilisearch/bump-meilisearch-v1.7.0
Browse files Browse the repository at this point in the history
Changes related to the next Meilisearch release (v1.7.0)
  • Loading branch information
brunoocasali authored Mar 11, 2024
2 parents bd3c8e0 + cb8d235 commit 1c9e66d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .code-samples.meilisearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -741,3 +741,5 @@ facet_search_3: |-
facetQuery: 'c',
facetName: 'genres'
})
search_parameter_guide_show_ranking_score_details_1: |-
client.index('movies').search('dragon', { showRankingScoreDetails: true })
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

0 comments on commit 1c9e66d

Please sign in to comment.