Skip to content

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

@0xthk

Description

@0xthk

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions