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

远程词典加载长度为0 #780

Open
maruixiang opened this issue May 20, 2020 · 1 comment
Open

远程词典加载长度为0 #780

maruixiang opened this issue May 20, 2020 · 1 comment

Comments

@maruixiang
Copy link

maruixiang commented May 20, 2020

服务端采用http 1.1 的Transfer-Encoding: chunked方式返回数据是没有content-length的,这时远程加载就有问题,建议把entity.getContentLength()注释掉,并且直接用EntityUtils.toString(entity,charset)。
代码:org.wltea.analyzer.dic.Dictionary#getRemoteWordsUnprivileged
if (entity.getContentLength() > 0) {
in = new BufferedReader(new InputStreamReader(entity.getContent(), charset));
String line;

@ijse
Copy link

ijse commented Aug 5, 2020

同样遇到这个问题,费了好大劲才找到原因。。。

我们通过接口返回词典内容,默认Response中没有Content-Length

shoukunhuai added a commit to shoukunhuai/elasticsearch-analysis-ik that referenced this issue Sep 5, 2020
Fix chunked content could not be read as it will not get content length
I see there is an issue infinilabs#780 and this fix it
medcl pushed a commit that referenced this issue Sep 6, 2020
Fix chunked content could not be read as it will not get content length
I see there is an issue #780 and this fix it
DustinPT pushed a commit to DustinPT/elasticsearch-analysis-ik that referenced this issue Dec 27, 2020
Fix chunked content could not be read as it will not get content length
I see there is an issue infinilabs#780 and this fix it

(cherry picked from commit 5a1b8c8)
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