1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-08-02 20:15:24 +02:00

feat: diacritic-insensitive search (#2132)

* add normalized columns and use them for search

* add migration to fill all normalized columns
This commit is contained in:
Sören 2023-02-20 01:40:18 +01:00 committed by GitHub
parent 670907b563
commit 6a5f9d7f6b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 201 additions and 11 deletions

View file

@ -463,6 +463,12 @@ def test_recipe_repo_search(database: AllRepositories, unique_user: TestUser):
group_id=unique_user.group_id,
name=name_3,
),
# Test diacritics
Recipe(
user_id=unique_user.user_id,
group_id=unique_user.group_id,
name="Rátàtôuile",
),
]
for recipe in recipes:
@ -494,3 +500,9 @@ def test_recipe_repo_search(database: AllRepositories, unique_user: TestUser):
assert len(ordered_result) == 2
assert ordered_result[0].name == name_3
assert ordered_result[1].name == name_1
# Test string normalization
normalized_result = database.recipes.page_all(pagination_query, search="ratat").items
print([r.name for r in normalized_result])
assert len(normalized_result) == 1
assert normalized_result[0].name == "Rátàtôuile"