{"id":539,"date":"2014-03-07T01:18:20","date_gmt":"2014-03-06T17:18:20","guid":{"rendered":"http:\/\/fineyi.com\/?p=539"},"modified":"2014-03-07T01:18:20","modified_gmt":"2014-03-06T17:18:20","slug":"centos6-4%e4%b8%8bcoreseek-4-1sphinx%e5%ae%89%e8%a3%85%e9%85%8d%e7%bd%ae%e6%89%8b%e8%ae%b0-%e5%ae%8c%e7%be%8e%e6%94%af%e6%8c%81mysql%e6%95%b0%e6%8d%ae%e6%ba%90","status":"publish","type":"post","link":"http:\/\/www.fineyi.com\/?p=539","title":{"rendered":"CentOS6.4\u4e0bcoreseek 4.1(sphinx)\u5b89\u88c5\u914d\u7f6e\u624b\u8bb0 \u5b8c\u7f8e\u652f\u6301MySQL\u6570\u636e\u6e90"},"content":{"rendered":"<div><span style=\"font-family: 'Microsoft Yahei';\"><b>CentOS6.4\u4e0bcoreseek 4.1(sphinx)\u5b89\u88c5\u914d\u7f6e\u624b\u8bb0 \u5b8c\u7f8e\u652f\u6301MySQL\u6570\u636e\u6e90 <\/b><\/span><\/div>\n<div><span style=\"font-family: 'Microsoft Yahei';\">\u7cfb\u7edf\u73af\u5883\uff1a <\/span><\/div>\n<div><span style=\"font-family: 'Microsoft Yahei';\">OS: \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 CentOS6.4 64\u4f4d <\/span><\/div>\n<div><span style=\"font-family: 'Microsoft Yahei';\">MySQL: \u00a0 \u00a0 \u00a0 \u00a0 \u00a05.1.63 <\/span><\/div>\n<div><span style=\"font-family: 'Microsoft Yahei';\">coreseek: \u00a0 \u00a0 \u00a0 \u00a04.1 <\/span><\/div>\n<div><\/div>\n<div><span style=\"font-family: 'Microsoft Yahei';\">\u5b89\u88c5\u3001\u914d\u7f6e\u8fc7\u7a0b\u5982\u4e0b\uff1a<\/span><\/div>\n<div>\n<pre class=\"lang:default decode:true\">#\u5f53\u524d\u8def\u5f84\n[root@E sphinx]# pwd\n\/home\/sphinx\n#\u5b89\u88c5\u4f9d\u8d56\u5305\n[root@E sphinx]# yum install make gcc g++ gcc-c++ libtool autoconf automake imake mysql-devel libxml2-devel expat-devel\n#\u4e0b\u8f7dcoreseek4.1\n[root@E sphinx]# wget http:\/\/www.coreseek.cn\/uploads\/csft\/4.0\/coreseek-4.1-beta.tar.gz\n#\u89e3\u538b\u7f29\n[root@E sphinx]# tar zxvf coreseek-4.1-beta.tar.gz\n#\u5b89\u88c5mmseg\n[root@E sphinx]# cd coreseek-4.1-beta\/mmseg-3.2.14\/\n[root@E mmseg-3.2.14]# .\/bootstrap #\u8f93\u51fa\u7684warning\u4fe1\u606f\u53ef\u4ee5\u5ffd\u7565\uff0c\u5982\u679c\u51fa\u73b0error\u5219\u9700\u8981\u89e3\u51b3\n[root@E mmseg-3.2.14]# .\/configure --prefix=\/usr\/local\/mmseg3\n[root@E mmseg-3.2.14]# make &amp;&amp; make install\n[root@E mmseg-3.2.14]# cd ..\n\n##\u5b89\u88c5coreseek\n[root@E coreseek-4.1-beta]# cd csft-4.1\/\n[root@E csft-4.1]# sh buildconf.sh #\u8f93\u51fa\u7684warning\u4fe1\u606f\u53ef\u4ee5\u5ffd\u7565\uff0c\u5982\u679c\u51fa\u73b0error\u5219\u9700\u8981\u89e3\u51b3\n[root@E csft-4.1]# .\/configure --prefix=\/usr\/local\/coreseek --without-unixodbc --with-mmseg --with-mmseg-includes=\/usr\/local\/mmseg3\/include\/mmseg\/ --with-mmseg-libs=\/usr\/local\/mmseg3\/lib\/ --with-mysql\n\n[root@E csft-4.1]# make &amp;&amp; make install\n[root@E csft-4.1]# cd ..\n\n#\u6d4b\u8bd5mmseg\u5206\u8bcd\uff0ccoreseek\u641c\u7d22\uff08\u9700\u8981\u9884\u5148\u8bbe\u7f6e\u597d\u5b57\u7b26\u96c6\u4e3azh_CN.UTF-8\uff0c\u786e\u4fdd\u6b63\u786e\u663e\u793a\u4e2d\u6587\uff09\n[root@E coreseek-4.1-beta]# cd testpack\/\n[root@E testpack]# cat var\/test\/test.xml #\u6b64\u65f6\u5e94\u8be5\u6b63\u786e\u663e\u793a\u4e2d\u6587\n#mmseg\u7a0b\u5e8f -d \u8bcd\u5e93\u76ee\u5f55 \u6307\u5b9a\u6570\u636e\u6e90\n[root@E testpack]# \/usr\/local\/mmseg3\/bin\/mmseg -d \/usr\/local\/mmseg3\/etc var\/test\/test.xml\n#\u521b\u5efa\u7d22\u5f15\n[root@E testpack]# \/usr\/local\/coreseek\/bin\/indexer -c etc\/csft.conf --all\n#\u6267\u884c\u641c\u7d22\u6d4b\u8bd5\n[root@E testpack]# \/usr\/local\/coreseek\/bin\/search -c etc\/csft.conf \u7f51\u7edc\u641c\u7d22\n#\u6d4b\u8bd5\u6210\u529f\nCoreseek Fulltext 4.1 [ Sphinx 2.0.2-dev (r2922)]\nCopyright (c) 2007-2011,\nBeijing Choice Software Technologies Inc (http:\/\/www.coreseek.com)\n\u00a0using config file 'etc\/csft.conf'...\nindex 'xml': query '\u7f51\u7edc\u641c\u7d22 ': returned 1 matches of 1 total in 0.000 sec\ndisplaying matches:\n1. document=1, weight=1590, published=Thu Apr 1 22:20:07 2010, author_id=1\nwords:\n1. '\u7f51\u7edc': 1 documents, 1 hits\n2. '\u641c\u7d22': 2 documents, 5 hits<\/pre>\n<\/div>\n<div><span style=\"font-family: 'Microsoft Yahei';\">#\u4e3a\u4e86\u4f7fsphinx\u76f4\u63a5\u652f\u6301mysql\u6570\u636e\u6e90 \u9700\u8981\u5bf9coreseek\u91cd\u65b0\u7f16\u8bd1\u5b89\u88c5 <\/span><\/div>\n<div><span style=\"font-family: 'Microsoft Yahei';\">#\u91cd\u65b0\u7f16\u8bd1\u5b89\u88c5\u540e\u7684coreseek\u53ef\u4ee5\u652f\u6301mysql\u548cxml\u6570\u636e\u6e90<\/span><\/div>\n<div>\n<pre class=\"lang:default decode:true\">[root@E testpack]# cd ..\n[root@E coreseek-4.1-beta]# pwd\n\/home\/sphinx\/coreseek-4.1-beta\n[root@E coreseek-4.1-beta]# cd csft-4.1\/$ make clean\n[root@E coreseek-4.1-beta]#.\/configure --prefix=\/usr\/local\/coreseek --without-unixodbc --with-mmseg --with-mmseg-includes=\/usr\/local\/mmseg3\/include\/mmseg\/ --with-mmseg-libs=\/usr\/local\/mmseg3\/lib\/ --with-mysql<\/pre>\n<\/div>\n<div><span style=\"font-family: 'Microsoft Yahei';\">###\u914d\u7f6e\u3001\u6d4b\u8bd5mysql\u6570\u636e\u6e90### <\/span><\/div>\n<div><span style=\"font-family: 'Microsoft Yahei';\">\u5bfc\u5165\u6d4b\u8bd5\u6570\u636e <a title=\"sphinx\u6d4b\u8bd5\u6570\u636esql\" href=\"http:\/\/pan.baidu.com\/s\/1kTuQQI7\" target=\"_blank\" rel=\"noopener\">sql\u70b9\u51fb\u4e0b\u8f7d<\/a><\/span><\/div>\n<div>\n<pre class=\"lang:default decode:true crayon-selected\">#\u5b89\u88c5mysql\u4f9d\u8d56\u5305\nyum install mysql mysql-server php-mysql -y\n#\u4fee\u6539\u914d\u7f6e\u914d\u7f6e\u6587\u4ef6\n[root@E testpack]# cd ..\/testpack\/\n[root@E testpack]# vi etc\/csft_mysql.conf\n#\u53ea\u9700\u8981\u4fee\u6539 \u6e90\u5b9a\u4e49 \u4e2d\u7684\u6570\u636e\u5e93\u7684\u76f8\u5173\u914d\u7f6e(\u6570\u636e\u5e93\u5730\u5740\u3001\u7528\u6237\u540d\u3001\u5bc6\u7801\u3001\u5e93\u540d) \u5176\u5b83\u914d\u7f6e\u4e0d\u9700\u4fee\u6539 \u5982\u4e0b\u6240\u793a\uff1a\n#\u6e90\u5b9a\u4e49\nsource mysql\n{\n\u00a0 \u00a0 type = mysql\n\u00a0 \u00a0 sql_host = localhost #\u6570\u636e\u5e93\u4e3b\u673a\u5730\u5740\n\u00a0 \u00a0 sql_user = root #\u6570\u636e\u5e93\u7528\u6237\u540d\n\u00a0 \u00a0 sql_pass = 111111 #\u6570\u636e\u5e93\u5bc6\u7801\n\u00a0 \u00a0 sql_db = sphinx #\u6570\u636e\u5e93\u5e93\u540d\n\u00a0 \u00a0 sql_port = 3306\n\u00a0 \u00a0 sql_query_pre = SET NAMES utf8\n\u00a0 \u00a0 sql_query = SELECT id, group_id, UNIX_TIMESTAMP(date_added) AS date_added, title, content FROM documents\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 #sql_query\u7b2c\u4e00\u5217id\u9700\u4e3a\u6574\u6570\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 #title\u3001content\u4f5c\u4e3a\u5b57\u7b26\u4e32\/\u6587\u672c\u5b57\u6bb5\uff0c\u88ab\u5168\u6587\u7d22\u5f15\n\u00a0 \u00a0 sql_attr_uint = group_id #\u4eceSQL\u8bfb\u53d6\u5230\u7684\u503c\u5fc5\u987b\u4e3a\u6574\u6570\n\u00a0 \u00a0 sql_attr_timestamp = date_added #\u4eceSQL\u8bfb\u53d6\u5230\u7684\u503c\u5fc5\u987b\u4e3a\u6574\u6570\uff0c\u4f5c\u4e3a\u65f6\u95f4\u5c5e\u6027\n\u00a0 \u00a0 sql_query_info_pre = SET NAMES utf8 #\u547d\u4ee4\u884c\u67e5\u8be2\u65f6\uff0c\u8bbe\u7f6e\u6b63\u786e\u7684\n\u5b57\u7b26\u96c6\n\u00a0 \u00a0 sql_query_info = SELECT * FROM documents WHERE id=$id #\u547d\u4ee4\u884c\u67e5\u8be2\u65f6\uff0c\u4ece\u6570\u636e\u5e93\u8bfb\u53d6\u539f\u59cb\u6570\u636e\u4fe1\u606f\n}<\/pre>\n<p>&nbsp;<\/p>\n<\/div>\n<div>\n<pre class=\"lang:default decode:true\">#\u521b\u5efamysql\u6570\u636e\u6e90\u7d22\u5f15\n[root@E testpack]# pwd\n\/home\/sphinx\/coreseek-4.1-beta\/testpack\n#\u7d22\u5f15\u5668 -c \u914d\u7f6e\u6587\u4ef6 --all\n[root@E testpack]# \/usr\/local\/coreseek\/bin\/indexer -c etc\/csft_mysql.conf --all\nCoreseek Fulltext 4.1 [ Sphinx 2.0.2-dev (r2922)]\nCopyright (c) 2007-2011,\nBeijing Choice Software Technologies Inc (http:\/\/www.coreseek.com)\n\u00a0using config file 'etc\/csft_mysql.conf'...\nindexing index 'mysql'...\nERROR: index 'mysql': sql_connect: Can't connect to local MySQL server through socket '\/var\/lib\/mysql\/mysql.sock' (2) (DSN=mysql:\/\/root:***@localhost:3306\/sphinx).\ntotal 0 docs, 0 bytes\ntotal 0.000 sec, 0 bytes\/sec, 0.00 docs\/sec\ntotal 0 reads, 0.000 sec, 0.0 kb\/call avg, 0.0 msec\/call avg\ntotal 0 writes, 0.000 sec, 0.0 kb\/call avg, 0.0 msec\/call avg<\/pre>\n<\/div>\n<div><span style=\"font-family: 'Microsoft Yahei';\">#\u4e0a\u9762\u6709\u62a5\u9519 \u521b\u5efa\u7d22\u5f15\u5931\u8d25 <\/span><\/div>\n<div><span style=\"font-family: 'Microsoft Yahei';\">#\u627e\u5230mysql.sock\u7684\u8def\u5f84\uff08\u53ef\u4ee5\u53bbmysql\u7684\u914d\u7f6e\u6587\u4ef6\/etc\/my.cnf\u4e2d\u67e5\u770b \u672c\u673a\u5728\/tmp\/mysql.sock\uff09 <\/span><\/div>\n<div><span style=\"font-family: 'Microsoft Yahei';\">#\u5efa\u7acb\u8f6f\u8fde\u63a5 <\/span><\/div>\n<div><span style=\"font-family: 'Microsoft Yahei';\">[root@E testpack]# mkdir \/var\/lib\/mysql <\/span><\/div>\n<div><span style=\"font-family: 'Microsoft Yahei';\">[root@E testpack]# ln -s \/tmp\/mysql.sock \/var\/lib\/mysql\/mysql.sock <\/span><\/div>\n<div><\/div>\n<div>\n<pre class=\"lang:default decode:true \">#\u521b\u5efamysql\u6570\u636e\u6e90\u7d22\u5f15\u6210\u529f\n[root@E testpack]# \/usr\/local\/coreseek\/bin\/indexer -c etc\/csft_mysql.conf --all\nCoreseek Fulltext 4.1 [ Sphinx 2.0.2-dev (r2922)]\nCopyright (c) 2007-2011,\nBeijing Choice Software Technologies Inc (http:\/\/www.coreseek.com)\n\u00a0using config file 'etc\/csft_mysql.conf'...\nindexing index 'mysql'...\ncollected 3 docs, 0.0 MB\nsorted 0.0 Mhits, 100.0% done\ntotal 3 docs, 7545 bytes\ntotal 0.016 sec, 467269 bytes\/sec, 185.79 docs\/sec\ntotal 3 reads, 0.000 sec, 2.8 kb\/call avg, 0.0 msec\/call avg\ntotal 9 writes, 0.000 sec, 2.2 kb\/call avg, 0.0 msec\/call avg\n\n#\u6d4b\u8bd5mysql\u6570\u636e\u6e90 \u641c\u7d22\n[root@E testpack]# \/usr\/local\/coreseek\/bin\/search -c etc\/csft_mysql.conf \u7f51\u7edc\u641c\u7d22\nCoreseek Fulltext 4.1 [ Sphinx 2.0.2-dev (r2922)]\nCopyright (c) 2007-2011,\nBeijing Choice Software Technologies Inc (http:\/\/www.coreseek.com)\n\u00a0using config file 'etc\/csft_mysql.conf'...\nindex 'mysql': query '\u7f51\u7edc\u641c\u7d22 ': returned 1 matches of 1 total in 0.000 sec\ndisplaying matches:\n1. document=1, weight=1590, group_id=2, date_added=Thu Apr 1 22:20:07 2010\n\u00a0 \u00a0 \u00a0 \u00a0 id=1\n\u00a0 \u00a0 \u00a0 \u00a0 title=\u611a\u4eba\u8282\u6700\u4f73\u86ca\u60d1\u7206\u6599 \u8c37\u6b4c300\u4ebf\u7f8e\u5143\u6536\u8d2d\u767e\u5ea6\n\u00a0 \u00a0 \u00a0 \u00a0 content=\u636e\u56fd\u5916\u5a92\u4f53\u62a5\u9053\uff0c\u8c37\u6b4c\u5c06\u5de8\u8d44\u6536\u8d2d\u767e\u5ea6\uff0c......&lt;\u6b63\u6587\u7701\u7565\u5f88\u591a\u5b57&gt;......\u674e\u5f66\u5b8f\u4e5f\u627f\u8ba4\u5f53\u524d\u767e\u5ea6\u5728\u65e5\u672c\u8fd8\u5904\u4e8e\u521d\u7ea7\u53d1\u5c55\u9636\u6bb5\uff0c\u4f46\u4ed6\u4e5f\u9884\u8a00\u201c2012\u5e74\uff0c\u767e\u5ea6\u4e0eGoogle\u5212\u6d0b\u800c\u6cbb\u201d\uff0c\u5bf9\u6b64\u6211\u4eec\u62ed\u76ee\u4ee5\u5f85\uff01\n\u00a0 \u00a0 \u00a0 \u00a0 date_added=2010-04-01 22:20:07\n\u00a0 \u00a0 \u00a0 \u00a0 author_id=1\n\u00a0 \u00a0 \u00a0 \u00a0 group_id=2\nwords:\n1. '\u7f51\u7edc': 1 documents, 1 hits\n2. '\u641c\u7d22': 2 documents, 5 hits<\/pre>\n<div><span style=\"font-family: 'Microsoft Yahei';\">coreseek\u8bcd\u5e93\u6269\u5c55\u8bf7\u53c2\u8003\uff1a<a title=\"sphinx(coreseek)\u5bfc\u5165\u641c\u72d7\u8bcd\u5e93\" href=\"http:\/\/fineyi.com\/archives\/330.html\" target=\"_blank\" rel=\"noopener\"><span style=\"color: #262626;\">sphinx(coreseek)\u5bfc\u5165\u641c\u72d7\u8bcd\u5e93<\/span><\/a><\/span><\/div>\n<div><span style=\"font-family: 'Microsoft Yahei';\">\u7a0d\u540e\u5b8c\u5584 \u5b9e\u65f6\u7d22\u5f15\u7684\u521b\u5efa\u53ca\u7ef4\u62a4<\/span><\/div>\n<p><span style=\"font-family: 'Microsoft Yahei';\">\u8f6c\u8f7d\u8bf7\u6ce8\u660e\u51fa\u5904\uff1a<a title=\"\u6021\u7136\u4e4b\u4e50\" href=\"http:\/\/fineyi.com\/\" target=\"_blank\" rel=\"noopener\">\u6021\u7136\u4e4b\u4e50 \u2013 FineYi<\/a><\/span><\/p>\n<p><span style=\"font-family: 'Microsoft Yahei';\">\u53c2\u8003\u8d44\u6599\uff1a<a title=\"BSD\/Linux\u4e0b\u7684\u5b89\u88c5\u6d4b\u8bd5\" href=\"http:\/\/www.coreseek.cn\/products-install\/install_on_bsd_linux\/\" target=\"_blank\" rel=\"noopener\"><span style=\"text-decoration: underline;\">coreseek<\/span><\/a>\u00a0and\u00a0<a title=\"CoreSeek\u5b89\u88c5\u6307\u5357\" href=\"http:\/\/www.coreseek.cn\/products-install\/install_on_macosx\/#sysdep\" target=\"_blank\" rel=\"noopener\"><span style=\"text-decoration: underline;\">coreseek<\/span>\u00a0<\/a><\/span><\/p>\n<\/div>\n<div><\/div>\n<div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>CentOS6.4\u4e0bcoreseek 4.1(sphinx)\u5b89\u88c5\u914d\u7f6e\u624b\u8bb0 \u5b8c\u7f8e\u652f &hellip; <a href=\"http:\/\/www.fineyi.com\/?p=539\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a> <a href=\"http:\/\/www.fineyi.com\/?p=539\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_mi_skip_tracking":false,"footnotes":""},"categories":[5,6,8,10],"tags":[19,21,30,32,35,42,58,59,69,71,82],"class_list":["post-539","post","type-post","status-publish","format-standard","hentry","category-linux","category-mysql","category-php","category-10","tag-centos","tag-coreseek","tag-linux","tag-mmseg","tag-mysql-2","tag-shpinx","tag-58","tag-59","tag-69","tag-71","tag-82"],"aioseo_notices":[],"_links":{"self":[{"href":"http:\/\/www.fineyi.com\/index.php?rest_route=\/wp\/v2\/posts\/539","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.fineyi.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.fineyi.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.fineyi.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.fineyi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=539"}],"version-history":[{"count":0,"href":"http:\/\/www.fineyi.com\/index.php?rest_route=\/wp\/v2\/posts\/539\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.fineyi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=539"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.fineyi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=539"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.fineyi.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=539"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}