python # settings.py HAYSTACK_CONNECTIONS = { 'default': { 'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine', 'PATH': '/path/to/whoosh/index', 'INCLUDE_SPELLING': True, 'INCLUDE_PARTIALS': True, 'OPTIONS': { 'tokenizer': 'jieba', 'use_file_mmap': False, }, }, } python # settings.py HAYSTACK_CONNECTIONS = { 'default': { 'ENGINE': 'haystack.backends.lucene_backend.LuceneSearchEngine', 'PATH': '/path/to/lucene/index', 'INCLUDE_SPELLING': True, 'INCLUDE_PARTIALS': True, 'LANGUAGE_CODE': 'zh', 'DEFAULT_OPERATOR': 'AND', }, } python # settings.py HAYSTACK_CONNECTIONS = { 'default': { 'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine', 'PATH': '/path/to/whoosh/index', 'INCLUDE_SPELLING': True, 'INCLUDE_PARTIALS': True, 'OPTIONS': { 'tokenizer': 'haystack.tokenizers.JiebaTokenizer', 'use_file_mmap': False, }, }, }


上一篇:
下一篇:
切换中文