xunsearch 安裝

記錄xunsearch 安裝 使用

Checking scws ... 1.2.3-dev
Checking scws dict ... ok
Checking libuuid ... yes: /var/webwww/xunsearch
Checking xapian-core-scws ... no
Installing xapian-core-scws (1.2.20) ... 
Extracting xapian-core-scws package ...
Configuring xapian-core-scws ...
-----
checking for fdatasync... yes
checking for fsync... yes
checking for pread... yes
checking for any prototype needed for pread... none required
checking for pwrite... yes
checking for any prototype needed for pwrite... none required
checking for link... yes
checking for scws... yes: /var/webwww/xunsearch
checking for scws_new in -lscws... no
configure: error: scws_new() NOT found in libscws, please check it first.
-----
ERROR: failed to configure xapian-core-scws, see 'setup.log' for more detail

這個錯誤需要定位到安裝目錄,這里是/var/webwww/xunsearch
cd ./lib
建立兩個軟鏈接(此方法無效) 共享空間惹的禍

去非共享目錄,一次就成功

+=================================================+
| Installation completed successfully, Thanks you |
| 安裝成功,感謝選擇和使用 xunsearch              |
+-------------------------------------------------+
| 說明和注意事項:                                |
| 1. 開啟/重新開啟 xunsearch 服務程序,命令如下: |
|    /var/web/xunsearch/bin/xs-ctl.sh restart
|    強烈建議將此命令寫入服務器開機腳本中         |
|                                                 |
| 2. 所有的索引數(shù)據(jù)將被保存在下面這個目錄中:     |
|    /var/web/xunsearch/data
|    如需要轉移到其它目錄,請使用軟鏈接。         |
|                                                 |
| 3. 您現(xiàn)在就可以在我們提供的開發(fā)包(SDK)基礎上    |
|    開發(fā)您自己的搜索了。                         |
|    目前只支持 PHP 語言,參見下面文檔:          |
|    /var/web/xunsearch/sdk/php/README
+=================================================+

使用部分

tp5使用composer引入
有個坑:

$xs = new XS('demo');   // 自動使用 $prefix/sdk/php/app/demo.ini 作項目配置文件
$xs = new XS('/path/to/demo.ini');  // 使用 /path/to/demo.ini

前者可能路徑錯誤,官方建議使用后者,如下

define ('XS_APP_ROOT', '/path/to/ini')
$xs = new \XS(XS_APP_ROOT);
清空項目索引內容
$xs->index->clean();

配置

文件名www.ini

項目名稱

project.name = www

字符集

project.default_charset = UTF-8

服務器連接參數(shù)

server.index = 8383
server.search = 8384

字段定義

[field_name]

type字段類型

type = string

string
numeric
date
id
title
body

index索引方式
通常情況默認值為 none ,但 id 型字段默認是 self ,title 型字段是 both ,body 型字段則固定為 mixed 。

index = none

none
self
mixed
both(self+mixed)

tokenizer 分詞器

tokenizer = default

full
none
split
xlen
xstep
scws

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯(lián)系作者
【社區(qū)內容提示】社區(qū)部分內容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發(fā)布,文章內容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內容

  • Spring Cloud為開發(fā)人員提供了快速構建分布式系統(tǒng)中一些常見模式的工具(例如配置管理,服務發(fā)現(xiàn),斷路器,智...
    卡卡羅2017閱讀 136,551評論 19 139
  • Android 自定義View的各種姿勢1 Activity的顯示之ViewRootImpl詳解 Activity...
    passiontim閱讀 179,012評論 25 709
  • sayusayme閱讀 549評論 0 1
  • 人們曾經認定,人的體能極限決定了沒有人能夠在4分鐘內跑完1英里。許多醫(yī)生、教練員為這個“定論”找到了許許多多的“科...
    無_名閱讀 759評論 3 4
  • 日間與師范老友聊了一陣,是夜,竟夢回母?!?還是在那個路口下車,西行幾十米,便來到母校的大門前。背后是路南的學校...
    葉小秋123閱讀 1,111評論 1 5

友情鏈接更多精彩內容