Skip to content

Commit

Permalink
Merge #495
Browse files Browse the repository at this point in the history
495: Fix matching_strategy_spec r=curquiza a=ellnix

# Pull Request

## Related issue
Fixes #494 

## PR checklist
Please check if your PR fulfills the following requirements:
- [X] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
- [X] Have you read the contributing guidelines?
- [X] Have you made sure that the title is accurate and descriptive of the changes?


Co-authored-by: ellnix <[email protected]>
Co-authored-by: Clémentine U. - curqui <[email protected]>
  • Loading branch information
3 people authored Oct 11, 2023
2 parents fb6bbc0 + bb41c1c commit cccf2e4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spec/meilisearch/index/search/matching_strategy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
include_context 'search books with nested fields'

it 'does a custom search with a matching strategy ALL' do
response = index.search('another french book', matching_strategy: 'all')
response = index.search('best book again', matching_strategy: 'all')

expect(response['hits'].count).to eq(1)
end

it 'does a custom search with a matching strategy LAST' do
response = index.search('french book', matching_strategy: 'last')
response = index.search('best book again', matching_strategy: 'last')

expect(response['hits'].count).to eq(2)
end
Expand Down
8 changes: 8 additions & 0 deletions spec/support/books_contexts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,14 @@
{
id: 7,
title: 'The Hitchhiker\'s Guide to the Galaxy'
},
{
id: 8,
title: 'Harry Potter and the Deathly Hallows',
info: {
comment: 'The best book again',
reviewNb: 1000
}
}
]
end
Expand Down

0 comments on commit cccf2e4

Please sign in to comment.