CommunityServer 2008.5 中文搜尋 CSModule
CS2008.5 已經出來一陣子了,中文搜尋 CSModule 其實之前也有做過一些研究,不過因為 CS2008.5 實在鳥問題太多 ( Blog 編輯時日期會變、CodeHighlight for Wiki、Wiki Fileviewer 沒作用、Blog ranks 出不來、少了兩個 theme、Wiki Options 根本就沒此檔案 ... 陸續發現中) ,在加上我可以用 Enterprise Search ( 這是我的錯,別打我 )
回到正題,在 CS2008.5 Express 版本上( 也就是沒用 Enterprise Search ) ,Wiki 是搜尋不到的,所以目前我改出來的 UnicodeCodeSearch CSModule,一樣也搜尋不到 Wiki ( 不是我故意的,Telligent 給的本來就沒有 )
這次除了原本的 UTF-8 like + English hash 搜尋模式外,另外提供了一個無論如何都會用 Like 搜尋,全部用 Like 搜尋的好處是可以關掉 indexjob 的 task ,除了少一點處理器使用,最主要是可以少了很多資料庫空間去存 hash
使用方法很簡單,用 notepad 改 CommunityServer.config
找到
<add
name = "SearchProvider"
type = "CommunityServer.Components.SearchBarrel.SearchBarrelProvider, CommunityServer.Components.SearchBarrel"
/>
如果是原本的 UTF-8 like + English hash 搜尋模式,替換成
<add
name = "SearchProvider"
type = "CommunityServer.UnicodeSearchBarrel.UnicodeSearchBarrelProvider1, CommunityServer.UnicodeSearchBarrel"
/>
如果你要全部都用 Like 搜尋,把 UnicodeSearchBarrelProvider1 改成 UnicodeSearchBarrelProvider2
<add
name = "SearchProvider"
type = "CommunityServer.UnicodeSearchBarrel.UnicodeSearchBarrelProvider2, CommunityServer.UnicodeSearchBarrel"
/>
想刪除 IndexJob task,就把這四行砍了
<task name = "ForumsIndexing" type = "CommunityServer.Components.SearchBarrel.ForumsSearchJob, CommunityServer.Components.SearchBarrel" enabled = "true" enableShutDown = "false" />
<task name = "WeblogIndexing" type = "CommunityServer.Components.SearchBarrel.WeblogSearchJob, CommunityServer.Components.SearchBarrel" enabled = "true" enableShutDown = "false" />
<task name = "MediaGalleryIndexing" type = "CommunityServer.Components.SearchBarrel.MediaGallerySearchJob, CommunityServer.Components.SearchBarrel" enabled = "true" enableShutDown = "false" />
<task name = "HubIndexing" type = "CommunityServer.Components.SearchBarrel.HubSearchJob, CommunityServer.Components.SearchBarrel" enabled = "true" enableShutDown = "false" />
下載bin檔:按此下載
原始碼下載:按此下載
