Skip to content

Commit

Permalink
Merge eb52ddb into 9a792e1
Browse files Browse the repository at this point in the history
  • Loading branch information
Patryk Szczepański committed Jul 8, 2022
2 parents 9a792e1 + eb52ddb commit 45e696b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.rst
Expand Up @@ -92,6 +92,8 @@ The backend has the following optional settings:
See `here <http://xapian.org/docs/apidoc/html/classXapian_1_1QueryParser.html#ac7dc3b55b6083bd3ff98fc8b2726c8fd>`__ for
more information about the different strategies.

- ``XAPIAN_NGRAM_MIN_LENGTH``, ``XAPIAN_NGRAM_MAX_LENGTH``: options used to configure custom ngram (phrases) length.

- ``HAYSTACK_XAPIAN_USE_LOCKFILE``: Use a lockfile to prevent database locking errors when running management commands with multiple workers.
Defaults to `True`.

Expand Down
4 changes: 2 additions & 2 deletions xapian_backend.py
Expand Up @@ -19,8 +19,8 @@
from haystack.models import SearchResult
from haystack.utils import get_identifier, get_model_ct

NGRAM_MIN_LENGTH = 2
NGRAM_MAX_LENGTH = 15
NGRAM_MIN_LENGTH = getattr(settings, 'XAPIAN_NGRAM_MIN_LENGTH', 2)
NGRAM_MAX_LENGTH = getattr(settings, 'XAPIAN_NGRAM_MAX_LENGTH', 15)

try:
import xapian
Expand Down

0 comments on commit 45e696b

Please sign in to comment.