Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Simplify dashboard product search
Jakub Draganek389cb16b1d2c
diff --git a/saleor/search/backends/postgresql_dashboard.py b/saleor/search/backends/postgresql_dashboard.pyindex 5a8a7f0b65..2998d5ffb5 100644--- a/saleor/search/backends/postgresql_dashboard.py+++ b/saleor/search/backends/postgresql_dashboard.py@@ -8,11 +8,8 @@ from ...userprofile.models import Userdef search_products(phrase):- name_sim = TrigramSimilarity('name', phrase)- ft_in_description = Q(description__search=phrase)- name_similar = Q(name_sim__gt=0.2)- return Product.objects.annotate(name_sim=name_sim).filter(- ft_in_description | name_similar)+ sv = SearchVector('name', 'description')+ return Product.objects.annotate(search=sv).filter(search=phrase)def search_orders(phrase):