Skip to content

Commit

Permalink
Merge #575
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
4 people authored Dec 23, 2024
2 parents 9106f5d + ff6dd19 commit d8facd1
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions spec/meilisearch/index/search/vector_search_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,33 @@
enable_vector_store(true)

documents = [
{ objectId: 0, _vectors: [0, 0.8, -0.2], title: 'Across The Universe' },
{ objectId: 1, _vectors: [1, -0.2, 0], title: 'All Things Must Pass' },
{ objectId: 2, _vectors: [0.5, 3, 1], title: 'And Your Bird Can Sing' }
{ objectId: 0, _vectors: { custom: [0, 0.8, -0.2] }, title: 'Across The Universe' },
{ objectId: 1, _vectors: { custom: [1, -0.2, 0] }, title: 'All Things Must Pass' },
{ objectId: 2, _vectors: { custom: [0.5, 3, 1] }, title: 'And Your Bird Can Sing' }
]
settings = {
embedders: {
custom: {
source: 'userProvided',
dimensions: 3
}
}
}

client.create_index('vector_test_search').await
new_index = client.index('vector_test_search')
new_index.update_settings(settings).await
new_index.add_documents(documents).await

expect(new_index.search(vector: [9, 9, 9])['hits']).to be_empty
expect(new_index.search('',
{ vector: [9, 9, 9],
hybrid: { embedder: 'custom', semanticRatio: 1.0 } })['hits']).not_to be_empty
expect(new_index.search('',
{ vector: [9, 9, 9],
hybrid: { embedder: 'custom', semanticRatio: 1.0 } })['semanticHitCount']).to be 3
expect(new_index.search('All Things Must Pass',
{ vector: [9, 9, 9],
hybrid: { embedder: 'custom', semanticRatio: 0.1 } })['semanticHitCount']).to be 2
expect(new_index.search('All Things Must Pass')['hits']).not_to be_empty
end
end

0 comments on commit d8facd1

Please sign in to comment.