analysis-ik
analysis-ik copied to clipboard
關於 remote_ext_dict 和資料 先後順序的問題
當 remote_ext_dict 中沒有 "外婆的澎湖灣" 時,實際搜尋時會找到很多資料
_analyze 的結果:外婆、的、澎湖灣
當 remote_ext_dict 加入 "外婆的澎湖灣"時,卻完全沒有一筆資料
_analyze 的結果:外婆的澎湖灣
這時我把資料重新匯入,發現有回傳結果了
步驟重現: 由於我用的是 babenkoivan/scout-elasticsearch-driver,以下步驟為該套件的語法
1.匯入資料 php artisan scout:import App\Models\Text 2.搜尋 "外婆的澎湖灣",非常多資料,但不精準 3.remote_ext_dict 加入 "外婆的澎湖灣",等待字典載入後搜尋結果為空 4.重新匯入資料,同步驟 1 5.重新搜尋 "外婆的澎湖灣",結果正常
是不是增加 remote_ext_dict 之後要重新匯入資料?
重複匯入資料會讓 indices 快速的變大,幾次之後只能整個 index 砍掉重建 使用 php artisan scout:flush App\Models\Text 作用不大
try POST your_index/_update_by_query?conflicts=proceed
after you update remote_ext_dict
I guess just do reindex when you update remote dictionary