Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Add Gin index for product full text search
Jakub Draganekdefb4d906b18
diff --git a/saleor/product/migrations/0038_auto_20171129_0616.py b/saleor/product/migrations/0038_auto_20171129_0616.pynew file mode 100644index 0000000000..9b940fb761--- /dev/null+++ b/saleor/product/migrations/0038_auto_20171129_0616.py@@ -0,0 +1,17 @@+# -*- coding: utf-8 -*-+# Generated by Django 1.11.5 on 2017-11-29 12:16+from __future__ import unicode_literals++from django.contrib.postgres.operations import BtreeGinExtension+from django.db import migrations+++class Migration(migrations.Migration):++ dependencies = [+ ('product', '0037_auto_20171124_0847'),+ ]++ operations = [+ BtreeGinExtension()+ ]diff --git a/saleor/product/models.py b/saleor/product/models.pyindex dce0420cd8..1e5bf0ee91 100644--- a/saleor/product/models.py+++ b/saleor/product/models.py@@ -5,6 +5,7 @@ from decimal import Decimalfrom django.conf import settingsfrom django.contrib.postgres.fields import HStoreField+from django.contrib.postgres.indexes import GinIndexfrom django.core.validators import MinValueValidator, RegexValidatorfrom django.db import modelsfrom django.db.models import F, Max, Q@@ -140,6 +141,7 @@ class Product(models.Model, ItemRange):class Meta:app_label = 'product'+ indexes = [GinIndex(fields=['name', 'description'])]permissions = (('view_product',pgettext_lazy('Permission description', 'Can view products')),