coreseek mysql安装_coreseek安装和使用(一)
什么是sphinx,sphinx和coreseek有什么區別和作用。
coreseek的安裝和配置。
coreseek的使用方式。
sphinx和coreseek
** sphinx: **
Sphinx是開源的搜索引擎,它支持英文的全文檢索。
** coreseek: **
單獨搭建Sphinx,已經可以使用全文索引了。但是往往我們要求的是中文索引,coreseek就是國人提供了一個可供企業使用的,基于Sphinx的中文全文檢索引擎。也就是說Coreseek實際上的內核還是Sphinx。
coreseek安裝流程和遇到問題的解決方法
第一步下載coreseek安裝包,點擊下載coreseek的3.2.14.tar.gz版本
下載完成后解壓進入coreseek目錄,會發現有兩個目錄csft-3.2.14和mmseg-3.2.14,這里簡單說明下:Csft-3.2.14就相當玩sphinx安裝目錄,mmseg-3.2.14即為中文分詞安裝包,先安裝中文分詞庫,請看代碼:
Cd coreseek-3.2.14/ mmseg-3.2.14
./configure --prefix=/usr/local/mmseg/
./configure出現錯誤:config.status: error: cannot find input file: src/Makefile.in
要先安裝automake,再重新執行configure
yum -y install autoconf automake
aclocal
yum -y install libtool
aclocal
libtoolize –force
automake --add-missing
make
make install
安裝中文分詞mmseg完畢,安裝coreseek。
cd ../ csft-3.2.14
./configure --prefix=/usr/local/coreseek --with-mysql=/usr/local/mysql --with-mmseg-includes=/usr/local/mmseg/include/mmseg/ --with-mmseg-libs=/usr/local/mmseg/lib/
make
make install
```
但我的環境是使用yum直接安裝的lnmp,不知道mysql的地址。需要先安裝mysql-devel ,再安裝csft的時候直接用-with-mysql 會自動搜索安裝的mysql的文件。重新執行上面的代碼,--with--mysql不用帶參數,自動搜索。
4. 安裝好coreseek和mmesg我們要給php加上sphinx模塊,這樣php就可以用到sphinx軟件的功能,先下載php的sphinx模塊包,代碼如下
wget http://pecl.php.net/get/sphinx-1.1.0.tgz
tar zxvf sphinx-1.1.0.tgz
cd sphinx-1.1.0
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make
make install
安裝擴張有可能遇到的錯誤:
一、configure: error: Cannot find libsphinxclient headers
解決方法:進入下載包的ctsf文件夾的api文件夾找到libsphinxclient文件夾,進入文件夾編譯安裝configure make && make isntall
二、/root/sphinx-1.1.0/sphinx.c:1888:43: warning: assignment from incompatible pointer type [enabled by default]
這是因為擴張的版本和以安裝的php的版本之間代碼的嚴格行造成的。
修改sphinx.c文件105行,添加默認值null
retval = std_hnd->read_property(object, member, type TSRMLS_CC, NULL);
配置擴展:在php.ini的下面加上:extension=”sphinx.so”
總結
以上是生活随笔為你收集整理的coreseek mysql安装_coreseek安装和使用(一)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: java面试题10 牛客:以下可以正确获
- 下一篇: python- 进阶 与flask的搭