Skip to content

Commit 29aa956

Browse files
Merge #998
998: add: frequency value for matchingStrategy search parameter r=sanders41 a=239yash # Pull Request ## Related issue Fixes #987 ## What does this PR do? - addition of frequency value for `matchingStrategy` search parameter ## PR checklist Please check if your PR fulfills the following requirements: - [X] Have you made sure that the title is accurate and descriptive of the changes? - [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? Thank you so much for contributing to Meilisearch! Co-authored-by: 239yash <[email protected]>
2 parents 4ca3371 + ddecb13 commit 29aa956

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

.code-samples.meilisearch.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,10 @@ search_parameter_guide_matching_strategy_2: |-
311311
client.index('movies').search('big fat liar', {
312312
'matchingStrategy': 'all'
313313
})
314+
search_parameter_guide_matching_strategy_3: |-
315+
client.index('movies').search('big fat liar', {
316+
'matchingStrategy': 'frequency'
317+
})
314318
search_parameter_guide_highlight_1: |-
315319
client.index('movies').search('winter feast', {
316320
'attributesToHighlight': ['overview']

tests/index/test_index_search_meilisearch.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,20 @@ def test_custom_search_params_with_matching_strategy_last(index_with_documents):
419419
assert len(response["hits"]) > 1
420420

421421

422+
def test_custom_search_params_with_matching_strategy_frequency(index_with_documents):
423+
"""Tests search with matching strategy param set to frequency"""
424+
response = index_with_documents().search(
425+
"man loves",
426+
{
427+
"limit": 5,
428+
"matchingStrategy": "frequency",
429+
},
430+
)
431+
432+
assert isinstance(response, dict)
433+
assert len(response["hits"]) > 1
434+
435+
422436
def test_custom_search_params_with_pagination_parameters(index_with_documents):
423437
"""Tests search with matching strategy param set to last"""
424438
response = index_with_documents().search("", {"hitsPerPage": 1, "page": 1})

0 commit comments

Comments
 (0)