Skip to content

Commit 1162b9d

Browse files
bors[bot]meili-botbrunoocasalialallema
authored
Merge #518
518: Changes related to the next Meilisearch release (v0.29.0) r=alallema a=meili-bot Related to this issue: meilisearch/integration-guides#211 This PR: - gathers the changes related to the next Meilisearch release (v0.29.0) so that this package is ready when the official release is out. - should pass the tests against the [latest pre-release of Meilisearch](https://github.com/meilisearch/meilisearch/releases). - might eventually contain test failures until the Meilisearch v0.29.0 is out. ⚠️ This PR should NOT be merged until the next release of Meilisearch (v0.29.0) is out. _This PR is auto-generated for the [pre-release week](https://github.com/meilisearch/integration-guides/blob/master/guides/pre-release-week.md) purpose._ Co-authored-by: meili-bot <[email protected]> Co-authored-by: Bruno Casali <[email protected]> Co-authored-by: Amélie <[email protected]>
2 parents 1ccc1b7 + 6c2d1f2 commit 1162b9d

File tree

4 files changed

+46
-7
lines changed

4 files changed

+46
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ index.search(
206206

207207
## 🤖 Compatibility with Meilisearch
208208

209-
This package only guarantees the compatibility with the [version v0.28.0 of Meilisearch](https://github.com/meilisearch/meilisearch/releases/tag/v0.28.0).
209+
This package only guarantees the compatibility with the [version v0.29.0 of Meilisearch](https://github.com/meilisearch/meilisearch/releases/tag/v0.29.0).
210210

211211
## 💡 Learn More
212212

tests/client/test_client_key_meilisearch.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@ def test_create_keys_with_options(client, test_key_info):
6262
assert key['actions'] == test_key_info['actions']
6363
assert key['indexes'] == test_key_info['indexes']
6464

65+
def test_create_keys_with_wildcarded_actions(client, test_key_info):
66+
"""Tests the creation of a key with an action which contains a wildcard."""
67+
key = client.create_key(options={'description': test_key_info['description'], 'actions': ['documents.*'], 'indexes': test_key_info['indexes'], 'expiresAt': None })
68+
69+
assert isinstance(key, dict)
70+
assert key['actions'] == ['documents.*']
71+
6572
def test_create_keys_without_actions(client):
6673
"""Tests the creation of a key with missing arguments."""
6774
with pytest.raises(MeiliSearchApiError):

tests/index/test_index_document_meilisearch.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,17 +91,23 @@ def test_update_documents(index_with_documents, small_movies):
9191
"""Tests updating a single document and a set of documents."""
9292
index = index_with_documents()
9393
response = index.get_documents()
94-
response.results[0].title = 'Some title'
95-
update = index.update_documents([dict(response.results[0])])
94+
doc = response.results[0]
95+
doc.title = 'Some title'
96+
97+
update = index.update_documents([dict(doc)])
98+
9699
assert isinstance(update, TaskInfo)
97100
assert update.task_uid != None
98101
index.wait_for_task(update.task_uid)
99-
response = index.get_documents()
100-
assert response.results[0].title == 'Some title'
102+
103+
response = index.get_document(doc.id)
104+
assert response.title == 'Some title'
105+
101106
update = index.update_documents(small_movies)
102107
index.wait_for_task(update.task_uid)
103-
response = index.get_documents()
104-
assert response.results[0].title != 'Some title'
108+
109+
response = index.get_document(doc.id)
110+
assert response.title != 'Some title'
105111

106112
@pytest.mark.parametrize('batch_size', [2, 3, 1000])
107113
@pytest.mark.parametrize(

tests/index/test_index_search_meilisearch.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,3 +436,29 @@ def test_search_on_nested_documents_with_sortable_attributes(index_with_document
436436
)
437437
assert isinstance(response, dict)
438438
assert response['hits'][0]['id'] == 6
439+
440+
def test_custom_search_params_with_matching_strategy_all(index_with_documents):
441+
"""Tests search with matching strategy param set to all"""
442+
response = index_with_documents().search(
443+
'man loves',
444+
{
445+
'limit': 5,
446+
'matchingStrategy': 'all',
447+
}
448+
)
449+
450+
assert isinstance(response, dict)
451+
assert len(response['hits']) == 1
452+
453+
def test_custom_search_params_with_matching_strategy_last(index_with_documents):
454+
"""Tests search with matching strategy param set to last"""
455+
response = index_with_documents().search(
456+
'man loves',
457+
{
458+
'limit': 5,
459+
'matchingStrategy': 'last',
460+
}
461+
)
462+
463+
assert isinstance(response, dict)
464+
assert len(response['hits']) > 1

0 commit comments

Comments
 (0)