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

es集群 调用了/_ansj/flush/config导致刷新接口/_ansj/flush/dic失效 #164

Closed
YeLuoXu opened this issue Jul 5, 2019 · 5 comments

Comments

@YeLuoXu
Copy link

YeLuoXu commented Jul 5, 2019

通过插件的master版本编译了es的版本为6.7.1
正常情况:调用词典刷新接口/_ansj/flush/dic能正常刷新词典。
异常情况:调用了/_ansj/flush/config刷新配置文件后,日志显示词典正常刷新,但是通过分词接口发现词典未生效
通过/_ansj/flush/dic正常刷新词典分词结果
image
通过/_ansj/flush/config刷新词典异常结果
image

上图停用词加上了 \s+ regex、测。
作者还在不在维护啊,这个问题目前没找到原因,求助。

@shi-yuan
Copy link
Member

刷新没问题的

@shi-yuan
Copy link
Member

可以试试tokenizer,tokenizer每次使用都会重新创建一个

@shi-yuan
Copy link
Member

shi-yuan commented Jul 21, 2019

analyzer,没变化,是因为有缓存,构造org.apache.lucene.analysis.Analyzer的时候,用的GLOBAL_REUSE_STRATEGY:

  /**
   * A predefined {@link ReuseStrategy}  that reuses the same components for
   * every field.
   */
  public static final ReuseStrategy GLOBAL_REUSE_STRATEGY = new ReuseStrategy() {

    @Override
    public TokenStreamComponents getReusableComponents(Analyzer analyzer, String fieldName) {
      return (TokenStreamComponents) getStoredValue(analyzer);
    }

    @Override
    public void setReusableComponents(Analyzer analyzer, String fieldName, TokenStreamComponents components) {
      setStoredValue(analyzer, components);
    }
  };

@YeLuoXu
Copy link
Author

YeLuoXu commented Aug 14, 2019

好的,知道了,感谢!

@shi-yuan
Copy link
Member

热更新问题已修复

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

2 participants