Adding WATSON_POSTGRES_SEARCH_CONFIG setting

This commit is contained in:
Dmitriev Alexander 2016-11-14 23:34:30 +03:00
parent 97af9a75f9
commit ab34cae822

View file

@ -5,6 +5,7 @@ from __future__ import unicode_literals
import abc
import re
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.db import connection, transaction
from django.db.models import Q
@ -173,7 +174,7 @@ class PostgresSearchBackend(SearchBackend):
"""A search backend that uses native PostgreSQL full text indices."""
search_config = "pg_catalog.english"
search_config = getattr(settings, "WATSON_POSTGRES_SEARCH_CONFIG", "pg_catalog.english")
"""Text search configuration to use in `to_tsvector` and `to_tsquery` functions"""
def escape_postgres_query(self, text):