Skip to content

Commit 146a16a

Browse files
authored
Merge pull request #364 from meilisearch/add-tests-to-matching
Add tests to custom search with `matching_strategy` param
2 parents 3234ff6 + db88115 commit 146a16a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# frozen_string_literal: true
2+
3+
RSpec.describe 'MeiliSearch::Index - Search with matching_strategy' do
4+
include_context 'search books with nested fields'
5+
6+
it 'does a custom search with a matching strategy ALL' do
7+
response = index.search('another french book', matching_strategy: 'all')
8+
9+
expect(response['hits'].count).to eq(1)
10+
end
11+
12+
it 'does a custom search with a matching strategy LAST' do
13+
response = index.search('french book', matching_strategy: 'last')
14+
15+
expect(response['hits'].count).to eq(2)
16+
end
17+
end

0 commit comments

Comments
 (0)