Skip to content

feat: expose a new option ANALYZER #1584

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zry656565
Copy link

@zry656565 zry656565 commented Jan 15, 2018

  • expose a new option ANALYZER, which enable to replace default analyzer
  • so we can replace default StemmingAnalyzer with a configured analyzer, like jieba.analyze.ChineseAnalyzer.
HAYSTACK_CONNECTIONS = {
    'default': {
        'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
        'PATH': os.path.join(PROJECT_DIR, 'whoosh_index'),
    },
    'chinese': {
        'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
        'PATH': os.path.join(PROJECT_DIR, 'whoosh_cn_index'),
        'ANALYZER': 'jieba.analyze.ChineseAnalyzer',
    },
}

@zry656565
Copy link
Author

Related issue: #990

@acdha
Copy link
Contributor

acdha commented Mar 9, 2018

It would probably be a good idea to add code to the Solr & ES backends to raise a NotImplementedError if ANALYZER is present until someone takes the time to add support to those backends.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants