-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
964: Added search cutoff ms settings r=sanders41 a=the-sinner # Pull Request ## Related issue Fixes #959 ## What does this PR do? - adds the search cutoff ms settings ## 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? Thank you so much for contributing to Meilisearch! Co-authored-by: Shalabh Agarwal <shalabhagarwal1024@gmail.com>
- Loading branch information
Showing
5 changed files
with
106 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
NEW_SEARCH_CUTOFF_MS = 150 | ||
|
||
|
||
def test_get_search_cutoff_ms(empty_index): | ||
"""Tests getting default search cutoff in ms.""" | ||
response = empty_index().get_search_cutoff_ms() | ||
assert response is None | ||
|
||
|
||
def test_update_search_cutoff_ms(empty_index): | ||
"""Tests updating search cutoff in ms.""" | ||
index = empty_index() | ||
response = index.update_search_cutoff_ms(NEW_SEARCH_CUTOFF_MS) | ||
update = index.wait_for_task(response.task_uid) | ||
assert update.status == "succeeded" | ||
response = index.get_search_cutoff_ms() | ||
assert NEW_SEARCH_CUTOFF_MS == response | ||
|
||
|
||
def test_reset_search_cutoff_ms(empty_index): | ||
"""Tests resetting the search cutoff to its default value.""" | ||
index = empty_index() | ||
# Update the settings first | ||
response = index.update_search_cutoff_ms(NEW_SEARCH_CUTOFF_MS) | ||
update = index.wait_for_task(response.task_uid) | ||
assert update.status == "succeeded" | ||
# Check the settings have been correctly updated | ||
response = index.get_search_cutoff_ms() | ||
assert NEW_SEARCH_CUTOFF_MS == response | ||
# Check the reset of the settings | ||
response = index.reset_search_cutoff_ms() | ||
update = index.wait_for_task(response.task_uid) | ||
assert update.status == "succeeded" | ||
response = index.get_search_cutoff_ms() | ||
assert response is None |