Skip to content

Commit 4e90e66

Browse files
Merge #548
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 <>
2 parents 6f2cbc2 + 48276a7 commit 4e90e66

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

.code-samples.meilisearch.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,10 @@ search_parameter_guide_matching_strategy_2: |-
347347
client.index('movies').search('big fat liar', {
348348
matching_strategy: 'all'
349349
})
350+
search_parameter_guide_matching_strategy_3: |-
351+
client.index('movies').search('white shirt', {
352+
matching_strategy: 'frequency'
353+
})
350354
search_parameter_guide_show_ranking_score_1: |-
351355
client.index('movies').search('dragon', {
352356
show_ranking_score: true

spec/meilisearch/client/indexes_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@
257257

258258
context 'when the index does not exist' do
259259
it 'raises an index not found error' do
260-
expect { client.fetch_index('books') }.to raise_index_not_found_meilisearch_api_error
260+
expect { client.fetch_index('bookss') }.to raise_index_not_found_meilisearch_api_error
261261
end
262262
end
263263
end

spec/meilisearch/index/search/matching_strategy_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,10 @@
1414

1515
expect(response['hits'].count).to eq(2)
1616
end
17+
18+
it 'does a custom search with a matching strategy frequency' do
19+
response = index.search('best book again', matching_strategy: 'frequency')
20+
21+
expect(response['hits'].count).to eq(1)
22+
end
1723
end

0 commit comments

Comments
 (0)