mirror of
https://github.com/Hopiu/django-watson.git
synced 2026-03-16 22:00:22 +00:00
Adding WATSON_POSTGRES_SEARCH_CONFIG setting
This commit is contained in:
parent
97af9a75f9
commit
ab34cae822
1 changed files with 2 additions and 1 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Reference in a new issue