ubuntu12.04 安裝 coreseek 4.1beta (轉)

來源:互聯網
上載者:User

標籤:des   blog   http   java   使用   os   io   strong   

         ubuntu 12.04安裝coreseek 4.1beta coreseek安裝需要預裝的軟體:

shell>apt-get install make gcc g++ automake libtool m4 autoconf mysql-client libmysqlclient15-dev libxml2-dev libexpat1-dev

 

##切換到root使用者,確保擁有完整的許可權來安裝軟體

$ su root

 

$ cd coreseek-4.1-beta

 

##中文測試環境檢查:

$  locale

##以下為核心項,locale為zh_CN.UTF-8,就可以正常顯示和輸入中文;

##如果不能正常顯示中文,則後面的中文測試部分無法正常進行,但不會影響coreseek的實際功能;

LANG=zh_CN.UTF-8

LC_ALL="zh_CN.UTF-8"

 

##確保可以正常顯示,否則請檢查當前環境的locale配置,以及當前環境或者用戶端已設定好支援UTF-8中文字元顯示

$ cat testpack/var/test/test.xml

 

##安裝coreseek開發的mmseg,為coreseek提供中文分詞功能

$ cd mmseg-3.2.14

##ubuntu環境下,需要使用ACLOCAL_FLAGS="-I /usr/share/aclocal" ./bootstrap

$ ./bootstrap

$ ./configure --prefix=/usr/local/mmseg3

$ make && make install

##如果提示libtool: unrecognized option `--tag=CC‘ ,請查看libtool問題解決方案

##安裝完成後,mmseg使用的詞典和設定檔,將自動安裝到/usr/local/mmseg3/etc中

 

##中文分詞測試,顯示不正常,請檢查當前環境下的locale和UTF-8中文字元顯示設定

$  /usr/local/mmseg3/bin/mmseg -d /usr/local/mmseg3/etc src/t1.txt

    中文/x 分/x 詞/x 測試/x 

    中國人/x 上海市/x 

Word Splite took: 1 ms.

##安裝coreseek:

##執行configure,進行編譯配置:

$ sh buildconf.sh

$ ./configure --prefix=/usr/local/coreseek --without-python --without-unixodbc --with-mmseg --with-mmseg-includes=/usr/local/mmseg3/include/mmseg/ --with-mmseg-libs=/usr/local/mmseg3/lib/ --with-mysql


$ make && make install

 

如果編譯出錯,出現類似於:

make[2]: *** [sphinxexpr.o] Error 1make[2]: Leaving directory `/home/mac/Downloads/coreseek-4.1-beta/csft-4.1/src‘make[1]: *** [all] Error 2make[1]: Leaving directory `/home/mac/Downloads/coreseek-4.1-beta/csft-4.1/src‘make: *** [all-recursive] Error 1
的問題,需要打一個補丁:


一個有用的連結:http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=667378,是關於coreseek上遊的sphinx的同樣問題的,看了一下瞭解似乎是gcc 4.7的C++範圍的問題,上面的debian bugs裡面提供了一個patch,看了下patch的內容,也對自己本地的coreseek的製作了同樣的補丁,壓縮包發布如下,使用時注意版本:sphinxexpr.cpp.patch.zip


[email protected]:/home/china/Downloads/coreseek-4.1-beta/csft-4.1# patch -p1 < /home/china/Downloads/sphinxexpr.cpp-csft-4.1-beta.patch
can‘t find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- /home/china/Downloads/coreseek-4.1-beta/csft-4.1/src/sphinxexpr.cpp    2011-10-07 20:08:58.000000000 +0800
|+++ sphinxexpr.cpp    2012-04-16 13:47:35.237820912 +0800 QQ:327168521
--------------------------
File to patch:

在file to patch:後輸入sphinxexpr.cpp檔案的位置  我當時輸入的是  /home/china/Downloads/coreseek-4.1-beta/csft-4.1/src/sphinxexpr.cpp

補丁打後就可以直接編譯通過了



##配置測試,測試是否可以正確運行

$ /usr/local/coreseek/bin/indexer -c /usr/local/coreseek/etc/sphinx-min.conf.dist

##以下為正常測試時的提示資訊:

   

Coreseek Fulltext 4.1 [ Sphinx 2.0.2-dev (r2922)]
Copyright (c) 2007-2011,
Beijing Choice Software Technologies Inc (http://www.coreseek.com)

 ERROR: nothing to do.

 

##至此,coreseek基礎環境正常安裝



$ cd testpack

 

$  /usr/local/coreseek/bin/indexer -c etc/csft.conf --all

 

$ /usr/local/coreseek/bin/search -c etc/csft.conf -a 服務

##以下為正常測試搜尋關鍵詞"服務"的資料

Coreseek Fulltext 4.1 [ Sphinx 2.0.2-dev (r2922)]

Copyright (c) 2007-2011,

Beijing Choice Software Technologies Inc (http://www.coreseek.com)

 

 using config file ‘etc/csft.conf‘...

index ‘xml‘: query ‘服務 ‘: returned 1 matches of 1 total in 0.015 sec

 

displaying matches:

1. document=3, weight=1, published=Wed Mar 31 21:01:00 2010, author_id=2

 

words:

1. ‘服務‘: 1 documents, 1 hits

 

$  /usr/local/coreseek/bin/searchd -c etc/csft.conf

##以下為正常開啟搜尋服務時的提示資訊:(csft-4.0版類似)

   Coreseek Fulltext 4.1 [ Sphinx 2.0.2-dev (r2922)]

    Copyright (c) 2007-2010,

    Beijing Choice Software Technologies Inc (http://www.coreseek.com)

 

    using config file ‘etc/csft.conf‘...

    listening on all interfaces, port=9312

##如要停止搜尋服務,/usr/local/coreseek/bin/searchd -c etc/csft.conf --stop

##如要已啟動服務,要更新索引,/usr/local/coreseek/bin/indexer -c etc/csft.conf --all --rotate

 

##然後,請參考csft-4.1下api目錄中的相關檔案,使用PHP、Python、Ruby、Java來測試搜尋服務;也可以前往< a href="/products-install/step_by_step/">搜尋服務建立三步曲,查看第三步使用PHP測試。


文章參考了並自己測試通過:http://blog.csdn.net/liangpz521/article/details/8795286和http://blog.csdn.net/andybegin/article/details/8724506

感謝原作者 本文轉自 http://blog.csdn.net/whzhcahzxh/article/details/17533143

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.