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

feat: expose a new option `ANALYZER` #1584

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@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

This comment has been minimized.

Show comment
Hide comment
@zry656565

zry656565 Jan 15, 2018

Related issue: #990

zry656565 commented Jan 15, 2018

Related issue: #990

@acdha

This comment has been minimized.

Show comment
Hide comment
@acdha

acdha Mar 9, 2018

Contributor

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.

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