Skip to content

Commit d8facd1

Browse files
meili-bors[bot]meili-botdureuillcurquiza
authored
Merge #575
575: Changes related to the next Meilisearch release (v1.12.0) r=curquiza a=meili-bot Related to this issue: meilisearch/integration-guides#307 This PR: - gathers the changes related to the next Meilisearch release (v1.12.0) 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.12.0 is out. ⚠️ This PR should NOT be merged until the next release of Meilisearch (v1.12.0) 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: meili-bot <[email protected]> Co-authored-by: Louis Dureuil <[email protected]> Co-authored-by: Clémentine <[email protected]>
2 parents 9106f5d + ff6dd19 commit d8facd1

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

spec/meilisearch/index/search/vector_search_spec.rb

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,33 @@
55
enable_vector_store(true)
66

77
documents = [
8-
{ objectId: 0, _vectors: [0, 0.8, -0.2], title: 'Across The Universe' },
9-
{ objectId: 1, _vectors: [1, -0.2, 0], title: 'All Things Must Pass' },
10-
{ objectId: 2, _vectors: [0.5, 3, 1], title: 'And Your Bird Can Sing' }
8+
{ objectId: 0, _vectors: { custom: [0, 0.8, -0.2] }, title: 'Across The Universe' },
9+
{ objectId: 1, _vectors: { custom: [1, -0.2, 0] }, title: 'All Things Must Pass' },
10+
{ objectId: 2, _vectors: { custom: [0.5, 3, 1] }, title: 'And Your Bird Can Sing' }
1111
]
12+
settings = {
13+
embedders: {
14+
custom: {
15+
source: 'userProvided',
16+
dimensions: 3
17+
}
18+
}
19+
}
1220

1321
client.create_index('vector_test_search').await
1422
new_index = client.index('vector_test_search')
23+
new_index.update_settings(settings).await
1524
new_index.add_documents(documents).await
1625

17-
expect(new_index.search(vector: [9, 9, 9])['hits']).to be_empty
26+
expect(new_index.search('',
27+
{ vector: [9, 9, 9],
28+
hybrid: { embedder: 'custom', semanticRatio: 1.0 } })['hits']).not_to be_empty
29+
expect(new_index.search('',
30+
{ vector: [9, 9, 9],
31+
hybrid: { embedder: 'custom', semanticRatio: 1.0 } })['semanticHitCount']).to be 3
32+
expect(new_index.search('All Things Must Pass',
33+
{ vector: [9, 9, 9],
34+
hybrid: { embedder: 'custom', semanticRatio: 0.1 } })['semanticHitCount']).to be 2
1835
expect(new_index.search('All Things Must Pass')['hits']).not_to be_empty
1936
end
2037
end

0 commit comments

Comments
 (0)