diff --git a/README.md b/README.md index cad76847..b426987e 100644 --- a/README.md +++ b/README.md @@ -197,7 +197,7 @@ JSON output: ## 🤖 Compatibility with Meilisearch -This package only guarantees the compatibility with the [version v0.28.0 of Meilisearch](https://github.com/meilisearch/meilisearch/releases/tag/v0.28.0). +This package only guarantees the compatibility with the [version v0.29.0 of Meilisearch](https://github.com/meilisearch/meilisearch/releases/tag/v0.29.0). ## 💡 Learn More diff --git a/spec/meilisearch/client/keys_spec.rb b/spec/meilisearch/client/keys_spec.rb index 4a83274c..3644be3a 100644 --- a/spec/meilisearch/client/keys_spec.rb +++ b/spec/meilisearch/client/keys_spec.rb @@ -31,6 +31,12 @@ expect(new_key['description']).to eq('A new key to add docs') end + it 'creates a key with wildcarded action' do + new_key = client.create_key(add_docs_key_options.merge(actions: ['documents.*'])) + + expect(new_key['actions']).to eq(['documents.*']) + end + it 'creates a key with setting uid' do new_key = client.create_key(add_docs_key_options.merge(uid: uuid_v4)) diff --git a/spec/meilisearch/index/search/matching_strategy_spec.rb b/spec/meilisearch/index/search/matching_strategy_spec.rb new file mode 100644 index 00000000..4324e627 --- /dev/null +++ b/spec/meilisearch/index/search/matching_strategy_spec.rb @@ -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