From fee9bdbd3f7156098f8506e4decc46d661c0fd0f Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 18 Feb 2021 13:39:59 +0000 Subject: [PATCH] cleanup --- products/tests.py | 4 +--- products/utils.py | 2 +- products/views.py | 1 + 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/products/tests.py b/products/tests.py index 6ece0cb..841c2f2 100644 --- a/products/tests.py +++ b/products/tests.py @@ -462,13 +462,11 @@ class ProductSearchTest(TestCase): def test_anon_user_can_search(self): expected_instances = [ self.factory(tags="lunares/blancos",description="zapatos verdes"), - # TODO: workaround vectorized search not liking nested tags self.factory(tags="colores/rojos, tono/brillante"), - # self.factory(tags="colores, rojos"), self.factory(tags="lunares/azules", description="zapatos rojos"), self.factory(tags="lunares/rojos", description="zapatos"), self.factory(attributes='"zapatos de campo", tono/oscuro'), - # TODO: workaround multi-word tags + # TODO: workaround for v3 with multi-word tags # self.factory(attributes='zapatos, "zapatos de campo", tono/oscuro'), ] unexpected_instances = [ diff --git a/products/utils.py b/products/utils.py index 22c1a92..35d98b3 100644 --- a/products/utils.py +++ b/products/utils.py @@ -97,7 +97,7 @@ def find_related_products_v2(keyword): def find_related_products_v3(keyword): """ - Fully loaded product search + Ranked product search SearchVectors for the fields SearchQuery for the value diff --git a/products/views.py b/products/views.py index 2c697d6..6c0b14f 100644 --- a/products/views.py +++ b/products/views.py @@ -160,6 +160,7 @@ def product_search(request): # products_qs = find_related_products_v3(chunk) for instance in products_qs: result_set.add(instance) + # TODO: add search for entire phrase # extract filters from result_set filters = extract_search_filters(result_set)