diff --git a/server/szurubooru/search/base_search_config.py b/server/szurubooru/search/base_search_config.py index a9b0e68..9f97973 100644 --- a/server/szurubooru/search/base_search_config.py +++ b/server/szurubooru/search/base_search_config.py @@ -62,11 +62,11 @@ class BaseSearchConfig(object): Decorate SQLAlchemy filter on given column using supplied criterion. ''' if isinstance(criterion, criteria.PlainSearchCriterion): - expr = column.like(transformer(criterion.value)) + expr = column.ilike(transformer(criterion.value)) elif isinstance(criterion, criteria.ArraySearchCriterion): expr = sqlalchemy.sql.false() for value in criterion.values: - expr = expr | column.like(transformer(value)) + expr = expr | column.ilike(transformer(value)) elif isinstance(criterion, criteria.RangedSearchCriterion): raise szurubooru.errors.SearchError( 'Composite token %r is invalid in this context.' % (criterion,)) diff --git a/server/szurubooru/tests/search/test_tag_search_config.py b/server/szurubooru/tests/search/test_tag_search_config.py index e03f038..2e834fc 100644 --- a/server/szurubooru/tests/search/test_tag_search_config.py +++ b/server/szurubooru/tests/search/test_tag_search_config.py @@ -22,6 +22,7 @@ def verify_unpaged(executor): ('t1', ['t1']), ('t2', ['t2']), ('t1,t2', ['t1', 't2']), + ('T1,T2', ['t1', 't2']), ]) def test_filter_anonymous(verify_unpaged, tag_factory, input, expected_tag_names): db.session.add(tag_factory(names=['t1']))