Skip to content

Commit

Permalink
Merge #548
Browse files Browse the repository at this point in the history
548: Accept the frequency value for the matchingStrategy search parameter r=curquiza a=andre-m-dev

# Pull Request

## Related issue
Fixes #545

## What does this PR do?
- ...

## 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: Andre <>
  • Loading branch information
meili-bors[bot] authored Jul 2, 2024
2 parents 6f2cbc2 + 48276a7 commit 4e90e66
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .code-samples.meilisearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,10 @@ search_parameter_guide_matching_strategy_2: |-
client.index('movies').search('big fat liar', {
matching_strategy: 'all'
})
search_parameter_guide_matching_strategy_3: |-
client.index('movies').search('white shirt', {
matching_strategy: 'frequency'
})
search_parameter_guide_show_ranking_score_1: |-
client.index('movies').search('dragon', {
show_ranking_score: true
Expand Down
2 changes: 1 addition & 1 deletion spec/meilisearch/client/indexes_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@

context 'when the index does not exist' do
it 'raises an index not found error' do
expect { client.fetch_index('books') }.to raise_index_not_found_meilisearch_api_error
expect { client.fetch_index('bookss') }.to raise_index_not_found_meilisearch_api_error
end
end
end
Expand Down
6 changes: 6 additions & 0 deletions spec/meilisearch/index/search/matching_strategy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,10 @@

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

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

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

0 comments on commit 4e90e66

Please sign in to comment.