Skip to content
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

为不同的index设置不同的remote_ext_dic #431

Closed
canghai118 opened this issue Sep 12, 2017 · 5 comments
Closed

为不同的index设置不同的remote_ext_dic #431

canghai118 opened this issue Sep 12, 2017 · 5 comments

Comments

@canghai118
Copy link

elastic 集群提供给多个租户使用。中文分词,希望能为不同的租户提供独立的自定义字典和分词。要如何实现?

若无法实现,是否可以考虑,请求remote_ext_dic时加上index参数?
谢谢

@snowcrazy
Copy link

同问

@happybearjoeyliu
Copy link

@medcl 不支持多租户,不知道是否有设计、性能上的考虑?有没有这方面的考虑或者计划呢?或者我想自己动手尝试下

@canghai118
Copy link
Author

时隔三年,再次回到这个issue,还是没进展啊。
这回瞄了一眼源码, 实现"多租户" 应该是可行的

    public interface AnalysisProvider<T> {

        /**
         * Creates a new analysis provider.
         *
         * @param indexSettings the index settings for the index this provider is created for
         * @param environment   the nodes environment to load resources from persistent storage
         * @param name          the name of the analysis component
         * @param settings      the component specific settings without context prefixes
         * @return a new provider instance
         * @throws IOException if an {@link IOException} occurs
         */
        T get(IndexSettings indexSettings, Environment environment, String name, Settings settings) throws IOException;

AnalysisProvider::get 方法中传入了IndexSettings. 这里应该能到拿到index name. 分词插件内部应该是可以根据index名称去读取不同的字典的


只不过,多少人有这个需求呢?

@canghai118
Copy link
Author

看来大佬们早就自己实现了啊
#678
#777

@liqunlin
Copy link

有个场景:已经配置好一个远程分词库地址 提供给一个业务使用,另一个业务也要使用自己的一个远程分词库。 请问 该如何做到都可以使用、互不影响?

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

No branches or pull requests

4 participants