Skip to content

Commit

Permalink
Add tests to custom search with matching_strategy param
Browse files Browse the repository at this point in the history
  • Loading branch information
brunoocasali committed Sep 2, 2022
1 parent f3af64e commit db88115
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions spec/meilisearch/index/search/matching_strategy_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# frozen_string_literal: true

RSpec.describe 'MeiliSearch::Index - Search with matching_strategy' do
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')

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')

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

0 comments on commit db88115

Please sign in to comment.