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

remote_ext_dict load success first time but failed after reload 遠端辭典第一次載入成功,但重新載入時就失效了 #1084

Open
0xthk opened this issue Nov 29, 2024 · 0 comments

Comments

@0xthk
Copy link

0xthk commented Nov 29, 2024

Description

我設置了 remote_ext_dict ,觀察 log 可以看到第一次載入是成功的,字典中的詞都可以正確斷出,但第二次 trigger 重新載入後就失效了。

Steps to reproduce

  1. 在字典(https://custom-domain.com/dict.txt)加入 "忠孝復興站"
  2. 啟動 elasticsearch
  3. 可以從 log 中看到 https://custom-domain.com/dict.txt 載入成功,analysis "忠孝復興站"結果正確被斷為一個詞
  4. 等待 10 分鐘,analysis-ik 自動重新載入詞典,再執行一次 "analysis "忠孝復興站" 結果
GET /_analyze 
{
  "analyzer": "ik_smart",
  "text":"忠孝復興站"
}
{
  "tokens": [
    {
      "token": "忠孝",
      "start_offset": 0,
      "end_offset": 2,
      "type": "CN_WORD",
      "position": 0
    },
    {
      "token": "復興",
      "start_offset": 2,
      "end_offset": 4,
      "type": "CN_WORD",
      "position": 1
    },
    {
      "token": "站",
      "start_offset": 4,
      "end_offset": 5,
      "type": "CN_CHAR",
      "position": 2
    }
  ]
}

Expected behavior

應該要使用遠端辭典中的詞來斷詞

Environment

  • Versions: Elasticsearch 8.12.2
  • Operating system and version: macOS 14.7, Ubuntu 18.04
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

1 participant