歡迎來到小豬圈!

2009-07-25

Sphinx 全文檢索引擎

  • Sphinx 0.9.8.1 加上 MySQL 5.1 在建立索引時會出現 column number 1 has no name 的錯誤訊息,改用目前最新 Sphinx 0.9.9 就行了。
  • 安裝成 Windows Service 時要明確指定 sphinx.conf 的路徑:
    searchd.exe --install --config C:\sphinx\sphinx.conf --servicename SphinxSearch
    不然會無法啟動並出現 service terminated unexpectedly 錯誤訊息。
  • 另外也要記得建立 log 、 query_log 、 pid_file 所指定的目錄。

  1. 下載 Sphinx 並壓縮至 C:\sphinx
  2. 依 sphinx.conf.in 或 sphinx-min.conf.in 編輯設定檔,並另存為 sphinx.conf 。
  3. 將工作目錄移至 cd \sphinx\bin
  4. 安裝成 Windows Services
    searchd.exe --install --config C:\sphinx\sphinx.conf --servicename SphinxSearch
  5. 建立索引
    indexer.exe --config C:\sphinx\sphinx.conf --all
  6. 測試搜尋,假設搜尋目標為 target-word
    search.exe --config C:\sphinx\sphinx.conf --any target-word
  7. 若要移除 Windows Services
    searchd.exe --delete --servicename SphinxSearch

No comments:

Post a Comment

Comment Form Message

標籤分類

Blog Archive

Labels

Google Analytics Tracking Code

About Me

My photo
Keelung, R.O.C, Taiwan
一個不學無術、混吃等死的傢伙…