../libtool: line 466: CDPATH: command not found
../libtool: line 1144: func_opt_split: command not found
libtool: Version mismatch error. This is libtool 2.2.6, but the
libtool: definition of this LT_INIT comes from an older release.
libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6
libtool: and run autoconf again.
make[1]: *** [conf_to_src] 错误 63
make[1]: Leaving directory `/home/andychu/lemp2/mysql-5.1.26-rc/strings’
make: *** [all-recursive] 错误 1
+————+———+———————————————————–+————–+—-+————+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+————+———+———————————————————–+————–+—-+————+
| CSV | YES | CSV storage engine | NO | NO | NO |
| SPHINX | YES | Sphinx storage engine 0.9.8 | NO | NO | NO |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
| MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great performance | NO | NO | NO |
| MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
+————+———+———————————————————–+————–+—-+————+
5 rows in set (0.00 sec)
此时我们可以看到已经包含sphinxSE 引擎
3.安装sphinx
cd /root/lemp/sphinx-0.9.8-rc2
./configure –prefix=/usr/local/sphinx –with-mysql=/opt/mysql \
–with-mysql-includes=/opt/mysql/include/mysql –with-mysql-libs=/opt/mysql/lib/mysql \
–with-mmseg-includes=/usr/local/mmseg/include –with-mmseg-libs=/usr/local/mmseg/lib –with-mmseg
make
头文件没找到:
tokenizer_zhcn.cpp:1:30: SegmenterManager.h: 没有那个文件或目录
tokenizer_zhcn.cpp:2:23: Segmenter.h: 没有那个文件或目录
make clean
./configure –prefix=/usr/local/sphinx –with-mysql=/opt/mysql \
–with-mysql-includes=/opt/mysql/include/mysql –with-mysql-libs=/opt/mysql/lib/mysql \
–with-mmseg-includes=/usr/local/mmseg/include/mmseg –with-mmseg-libs=/usr/local/mmseg/lib –with-mmseg
/root/sphinx/sphinx-0.9.8-rc2/src/tokenizer_zhcn.cpp:34: undefined reference to `libiconv_close’
collect2: ld returned 1 exit status
官网解决办法:
In the meantime I’ve change the configuration file and set
#define USE_LIBICONV 0 in line 8179.
修改configure 文件把 #define USE_LIBICONV 0 最后的数值由1改为0
重新编译。
vi configure
输入/define USE_LIBICONV 找到目标行
按i键后将1改成0,按esc,输入:wq保存退出
make
make install
编译时报如下的错误
/usr/local/include/mmseg/freelist.h:22: error: ‘strlen’ was not declared in this scope
vi /usr/local/include/mmseg/freelist.h
或者这个地址
vi /usr/local/mmseg/include/mmseg/freelist.h
加上
#include
再次编译就不会报错了。
复制一份sphinx的配置
cd /usr/local/sphinx/etc
cp sphinx.conf.dist sphinx.conf
4.配置sphinx
修改/usr/local/sphinx/etc/sphinx.conf
type = mysql
# some straightforward parameters for SQL source types
sql_host = localhost
sql_user = root
sql_pass =
sql_db = test
sql_port = 3306 # optional, default is 3306
address = 127.0.0.1 #安全点可以只监听本机
2 通过search工具查询
/usr/local/sphinx/bin/search –config /usr/local/sphinx/etc/sphinx.conf test
3 通过php的接口查询 详见sphinxapi.php.
三、在mysql中的使用SphinxSE方式调用Sphinx
1.在mysql中的使用SphinxSE方式调用Sphinx
首先建立一张索引专用表:
CREATE TABLE `sphinx` (
`id` int(11) NOT NULL,
`weight` int(11) NOT NULL,
`query` varchar(255) NOT NULL,
`CATALOGID` INT NOT NULL,
`EDITUSERID` INT NOT NULL,
`HITS` INT NULL,
`ADDTIME` INT NOT NULL, KEY
`Query` (`Query`)
) ENGINE=SPHINX DEFAULT CHARSET=utf8 CONNECTION=’sphinx://localhost:3312/test1′
强大!!!!谢谢!!!!最近也在研究这个东西!!!
如何在windows上面安装啊??
你好,我想问下你建立的那个 sphinx 表的内容从哪里来呢?
/usr/local/sphinx/etc/example.sql
测试数据是自已填的
总结的很全,谢谢分享。遇到的问题都解决了,就是在更新documents中的内容时(更新前将searchd kill掉了),更新后重新建立索引,在查询的时候没有相应的结果,请博主指点下,谢谢!我的mail:[email protected]