{"id":185,"date":"2008-09-05T17:36:22","date_gmt":"2008-09-05T10:36:22","guid":{"rendered":"http:\/\/ton.packetlove.com\/blog\/?p=185"},"modified":"2008-09-05T17:43:07","modified_gmt":"2008-09-05T10:43:07","slug":"mysql-sphinxse-and-php-sphinx-extension","status":"publish","type":"post","link":"https:\/\/ton.packetlove.com\/blog\/unix\/mysql-sphinxse-and-php-sphinx-extension.html","title":{"rendered":"MySQL SphinxSE and PHP Sphinx Extension"},"content":{"rendered":"<p><a href=\"http:\/\/ton.packetlove.com\/blog\/wp-content\/uploads\/2008\/09\/sphinx.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-186\" title=\"Sphinx a full-text search engine\" src=\"http:\/\/ton.packetlove.com\/blog\/wp-content\/uploads\/2008\/09\/sphinx.jpg\" alt=\"\" width=\"200\" height=\"51\" \/><\/a><\/p>\n<p><a title=\"Sphinx is a full-text search engine\" href=\"http:\/\/www.sphinxsearch.org\"><strong>Sphinx<\/strong><\/a> a full-text search engine<\/p>\n<p>\u0e15\u0e2d\u0e19\u0e19\u0e35\u0e49 Server \u0e19\u0e34\u0e48\u0e07\u0e41\u0e25\u0e49\u0e27 \u0e01\u0e47\u0e40\u0e25\u0e22\u0e21\u0e35\u0e40\u0e27\u0e25\u0e32\u0e21\u0e32\u0e17\u0e33 R&amp;D \u0e40\u0e01\u0e35\u0e48\u0e22\u0e27\u0e01\u0e31\u0e1a\u0e23\u0e30\u0e1a\u0e1a Search<br \/>\n\u0e40\u0e1e\u0e37\u0e48\u0e48\u0e2d\u0e19\u0e15\u0e31\u0e49\u0e21 (<a title=\"Thai Ajax\" href=\"http:\/\/www.thaiajax.com\">http:\/\/www.thaiajax.com<\/a>) \u0e42\u0e1b\u0e40\u0e01\u0e21\u0e48\u0e2d\u0e19\u0e40\u0e17\u0e1e \u0e41\u0e19\u0e30\u0e19\u0e33<br \/>\n\u0e27\u0e48\u0e32\u0e43\u0e2b\u0e49\u0e40\u0e2d\u0e32 <strong>Sphinx<\/strong> \u0e21\u0e32\u0e0a\u0e48\u0e27\u0e22 \u0e01\u0e47\u0e40\u0e25\u0e22\u0e15\u0e49\u0e2d\u0e07\u0e40\u0e1b\u0e47\u0e19\u0e2b\u0e19\u0e49\u0e32\u0e17\u0e35\u0e48\u0e1c\u0e21 \u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e17\u0e33 Server<br \/>\n\u0e43\u0e2b\u0e49 Support \u0e2b\u0e32\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e44\u0e14\u0e49\u0e19\u0e49\u0e2d\u0e22\u0e21\u0e32\u0e01\u0e40\u0e01\u0e35\u0e48\u0e22\u0e27\u0e01\u0e31\u0e1a\u0e15\u0e31\u0e27 Sphinx \u0e22\u0e34\u0e48\u0e07\u0e43\u0e19\u0e44\u0e17\u0e22<br \/>\n\u0e40\u0e17\u0e48\u0e32\u0e17\u0e35\u0e48\u0e40\u0e2b\u0e47\u0e19 \u0e22\u0e31\u0e07\u0e44\u0e21\u0e48\u0e21\u0e35\u0e40\u0e25\u0e22 \u0e40\u0e1e\u0e23\u0e32\u0e30\u0e04\u0e07\u0e44\u0e21\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e43\u0e0a\u0e49\u0e16\u0e36\u0e07\u0e02\u0e19\u0e32\u0e14\u0e19\u0e35\u0e49 \u0e23\u0e30\u0e1a\u0e1a\u0e44\u0e21\u0e48\u0e43\u0e2b\u0e0d\u0e48 ..<br \/>\n\u0e19\u0e31\u0e48\u0e07\u0e07\u0e21\u0e2d\u0e22\u0e39\u0e48\u0e19\u0e32\u0e19\u0e40\u0e2b\u0e21\u0e37\u0e2d\u0e19\u0e01\u0e31\u0e19 \u0e40\u0e1e\u0e23\u0e32\u0e30\u0e44\u0e21\u0e48\u0e40\u0e04\u0e22\u0e43\u0e0a\u0e49 \u0e2b\u0e32\u0e2d\u0e48\u0e32\u0e19 Doc \u0e02\u0e2d\u0e07\u0e40\u0e27\u0e47\u0e1a Sphinx<br \/>\n\u0e01\u0e47\u0e21\u0e35\u0e43\u0e2b\u0e49\u0e2d\u0e48\u0e32\u0e19\u0e19\u0e49\u0e2d\u0e22\u0e21\u0e32\u0e01 \u0e46 \u0e41\u0e15\u0e48\u0e40\u0e27\u0e47\u0e1a\u0e2d\u0e37\u0e48\u0e19 \u0e46 \u0e21\u0e35\u0e2d\u0e22\u0e39\u0e48\u0e1e\u0e2d\u0e2a\u0e21\u0e04\u0e27\u0e23 ..<\/p>\n<p>\u0e15\u0e2d\u0e19\u0e19\u0e35\u0e49\u0e40\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19\u0e01\u0e32\u0e23\u0e1b\u0e23\u0e31\u0e1a\u0e41\u0e15\u0e48\u0e07\u0e2d\u0e30\u0e44\u0e23 \u0e01\u0e47\u0e01\u0e33\u0e25\u0e31\u0e07 test \u0e01\u0e31\u0e19\u0e2d\u0e22\u0e39\u0e48 \u0e1c\u0e21\u0e40\u0e2d\u0e32<br \/>\n\u0e27\u0e34\u0e18\u0e35\u0e01\u0e32\u0e23 config \u0e21\u0e32\u0e43\u0e2b\u0e49\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e19 \u0e46 \u0e17\u0e35\u0e48\u0e2a\u0e19\u0e43\u0e08\u0e44\u0e14\u0e49\u0e2d\u0e48\u0e32\u0e19\u0e01\u0e31\u0e19\u0e25\u0e30\u0e01\u0e31\u0e19 \u0e40\u0e1e\u0e23\u0e32\u0e30\u0e27\u0e48\u0e32\u0e01\u0e27\u0e48\u0e32\u0e17\u0e35\u0e48<br \/>\n\u0e1c\u0e21\u0e08\u0e30 config \u0e44\u0e14\u0e49 \u0e01\u0e47\u0e43\u0e0a\u0e49\u0e40\u0e27\u0e25\u0e32\u0e1e\u0e2d\u0e2a\u0e21\u0e04\u0e27\u0e23\u0e40\u0e2b\u0e21\u0e37\u0e2d\u0e19\u0e01\u0e31\u0e19 \u0e40\u0e25\u0e22\u0e40\u0e2d\u0e32\u0e21\u0e32\u0e41\u0e1a\u0e48\u0e07\u0e1b\u0e31\u0e19 ..<\/p>\n<p><strong>Install MySQL SphinxSE CentOS 5.2<\/strong><br \/>\n<code><br \/>\nyum -y install bison patch automake libtool<\/code><\/p>\n<p>wget http:\/\/www.sphinxsearch.com\/downloads\/sphinx-0.9.8.tar.gz<br \/>\nwget http:\/\/dev.mysql.com\/get\/Downloads\/MySQL-5.0\/mysql-5.0.67.tar.gz\/from\/http:\/\/mysql.thaiweb.net\/<br \/>\ntar xfz sphinx*<br \/>\ntar xfz mysql*<\/p>\n<p>cd mysql*<br \/>\npatch -p1 &lt; ..\/sphinx-0.9.8\/mysqlse\/sphinx.5.0.37.diff<br \/>\nBUILD\/autorun.sh<br \/>\nmkdir sql\/sphinx<br \/>\ncp ..\/sphinx-0.9.8\/mysqlse\/* sql\/sphinx<br \/>\n.\/configure &#8211;prefix=\/usr\/local\/mysql &#8211;with-sphinx-storage-engine<br \/>\nmake<br \/>\nmake install<\/p>\n<p>cp support-files\/mysql.server \/etc\/init.d\/<br \/>\n\/etc\/init.d\/mysql.server start<\/p>\n<p>mysql&gt; SHOW ENGINES;<br \/>\n+&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<br \/>\n| Engine     | Support | Comment                                                        |<br \/>\n+&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<br \/>\n| MyISAM     | DEFAULT | Default engine as of MySQL 3.23 with great performance         |<br \/>\n| MEMORY     | YES     | Hash based, stored in memory, useful for temporary tables      |<br \/>\n| InnoDB     | YES     | Supports transactions, row-level locking, and foreign keys     |<br \/>\n| BerkeleyDB | NO      | Supports transactions and page-level locking                   |<br \/>\n| BLACKHOLE  | NO      | \/dev\/null storage engine (anything you write to it disappears) |<br \/>\n| EXAMPLE    | NO      | Example storage engine                                         |<br \/>\n| ARCHIVE    | NO      | Archive storage engine                                         |<br \/>\n| CSV        | NO      | CSV storage engine                                             |<br \/>\n| SPHINX     | YES     | Sphinx storage engine 0.9.8                                    |<br \/>\n| ndbcluster | NO      | Clustered, fault-tolerant, memory-based tables                 |<br \/>\n| FEDERATED  | NO      | Federated MySQL storage engine                                 |<br \/>\n| MRG_MYISAM | YES     | Collection of identical MyISAM tables                          |<br \/>\n| ISAM       | NO      | Obsolete storage engine                                        |<br \/>\n+&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<br \/>\n13 rows in set (0.00 sec)<\/p>\n<p><strong>Install Sphinx<\/strong><br \/>\n<code><br \/>\ncd ..\/sphinx*<br \/>\n.\/configure --prefix=\/usr\/local\/sphinx --with-mysql<br \/>\nmake<br \/>\nmake install<\/code><\/p>\n<p>cd api\/libsphinxclient<br \/>\nchmod +x buildconf.sh<br \/>\n.\/buildconf.sh<br \/>\n.\/configure<br \/>\nmake<br \/>\nmake install<\/p>\n<p><strong>Install PHP Sphinx extension<\/strong><br \/>\n<a href=\"http:\/\/pecl.php.net\/package\/sphinx\">http:\/\/pecl.php.net\/package\/sphinx<\/a><\/p>\n<p><code><br \/>\ncd ..\/..\/..\/<br \/>\nwget http:\/\/th.php.net\/get\/php-5.2.6.tar.gz\/from\/this\/mirror<br \/>\nwget http:\/\/pecl.php.net\/get\/sphinx-0.2.0.tgz<\/code><\/p>\n<p>tar xfz php-5.2.6.tar.gz<br \/>\ntar xfz sphinx-0.2.0.tgz<br \/>\nmv sphinx-0.2.0 php-5.2.6\/ext\/sphinx<br \/>\nrm configure<br \/>\n.\/buildconf &#8211;force<br \/>\n.\/configure &#8211;with-apxs2=\/usr\/local\/apache\/bin\/apxs &#8211;with-mysql=\/usr\/local\/mysql &#8211;enable-force-cgi-redirect &#8211;with-gettext &#8211;with-zlib-dir=\/usr\/local\/zlib &#8211;enable-mbstring &#8211;with-curl=\/usr\/local\/lib &#8211;with-sphinx<br \/>\nmake<br \/>\nmake install<\/p>\n<p>\u0e17\u0e33\u0e19\u0e35\u0e49\u0e01\u0e47\u0e40\u0e1b\u0e47\u0e19\u0e2d\u0e31\u0e19\u0e40\u0e23\u0e35\u0e22\u0e1a\u0e23\u0e49\u0e2d\u0e22\u0e41\u0e25\u0e49\u0e27\u0e04\u0e23\u0e31\u0e1a \u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a <strong>MySQL<\/strong>+<strong>SphinxSE<\/strong><br \/>\n\u0e41\u0e25\u0e30 <strong>PHP Sphinx Extension<\/strong><\/p>\n<div class=\"fcbkbttn_buttons_block\" id=\"fcbkbttn_left\"><div class=\"fcbkbttn_like \"><fb:like href=\"https:\/\/ton.packetlove.com\/blog\/unix\/mysql-sphinxse-and-php-sphinx-extension.html\" action=\"like\" colorscheme=\"light\" layout=\"button_count\"  size=\"small\"><\/fb:like><\/div><div class=\"fb-share-button  \" data-href=\"https:\/\/ton.packetlove.com\/blog\/unix\/mysql-sphinxse-and-php-sphinx-extension.html\" data-type=\"button_count\" data-size=\"small\"><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Sphinx a full-text search engine \u0e15\u0e2d\u0e19\u0e19\u0e35\u0e49 Server \u0e19\u0e34\u0e48\u0e07\u0e41\u0e25\u0e49\u0e27 \u0e01\u0e47\u0e40\u0e25\u0e22\u0e21\u0e35\u0e40\u0e27\u0e25\u0e32\u0e21\u0e32\u0e17\u0e33 R&amp;D \u0e40\u0e01\u0e35\u0e48\u0e22\u0e27\u0e01\u0e31\u0e1a\u0e23\u0e30\u0e1a\u0e1a Search \u0e40\u0e1e\u0e37\u0e48\u0e48\u0e2d\u0e19\u0e15\u0e31\u0e49\u0e21 (http:\/\/www.thaiajax.com) \u0e42\u0e1b\u0e40\u0e01\u0e21\u0e48\u0e2d\u0e19\u0e40\u0e17\u0e1e \u0e41\u0e19\u0e30\u0e19\u0e33 \u0e27\u0e48\u0e32\u0e43\u0e2b\u0e49\u0e40\u0e2d\u0e32 Sphinx \u0e21\u0e32\u0e0a\u0e48\u0e27\u0e22 \u0e01\u0e47\u0e40\u0e25\u0e22\u0e15\u0e49\u0e2d\u0e07\u0e40\u0e1b\u0e47\u0e19\u0e2b\u0e19\u0e49\u0e32\u0e17\u0e35\u0e48\u0e1c\u0e21 \u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e17\u0e33 Server \u0e43\u0e2b\u0e49 Support \u0e2b\u0e32\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e44\u0e14\u0e49\u0e19\u0e49\u0e2d\u0e22\u0e21\u0e32\u0e01\u0e40\u0e01\u0e35\u0e48\u0e22\u0e27\u0e01\u0e31\u0e1a\u0e15\u0e31\u0e27 Sphinx \u0e22\u0e34\u0e48\u0e07\u0e43\u0e19\u0e44\u0e17\u0e22 \u0e40\u0e17\u0e48\u0e32\u0e17\u0e35\u0e48\u0e40\u0e2b\u0e47\u0e19 \u0e22\u0e31\u0e07\u0e44\u0e21\u0e48\u0e21\u0e35\u0e40\u0e25\u0e22 \u0e40\u0e1e\u0e23\u0e32\u0e30\u0e04\u0e07\u0e44\u0e21\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e43\u0e0a\u0e49\u0e16\u0e36\u0e07\u0e02\u0e19\u0e32\u0e14\u0e19\u0e35\u0e49 \u0e23\u0e30\u0e1a\u0e1a\u0e44\u0e21\u0e48\u0e43\u0e2b\u0e0d\u0e48 .. \u0e19\u0e31\u0e48\u0e07\u0e07\u0e21\u0e2d\u0e22\u0e39\u0e48\u0e19\u0e32\u0e19\u0e40\u0e2b\u0e21\u0e37\u0e2d\u0e19\u0e01\u0e31\u0e19 \u0e40\u0e1e\u0e23\u0e32\u0e30\u0e44\u0e21\u0e48\u0e40\u0e04\u0e22\u0e43\u0e0a\u0e49 \u0e2b\u0e32\u0e2d\u0e48\u0e32\u0e19 Doc \u0e02\u0e2d\u0e07\u0e40\u0e27\u0e47\u0e1a Sphinx \u0e01\u0e47\u0e21\u0e35\u0e43\u0e2b\u0e49\u0e2d\u0e48\u0e32\u0e19\u0e19\u0e49\u0e2d\u0e22\u0e21\u0e32\u0e01 \u0e46 \u0e41\u0e15\u0e48\u0e40\u0e27\u0e47\u0e1a\u0e2d\u0e37\u0e48\u0e19 \u0e46 \u0e21\u0e35\u0e2d\u0e22\u0e39\u0e48\u0e1e\u0e2d\u0e2a\u0e21\u0e04\u0e27\u0e23 .. \u0e15\u0e2d\u0e19\u0e19\u0e35\u0e49\u0e40\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19\u0e01\u0e32\u0e23\u0e1b\u0e23\u0e31\u0e1a\u0e41\u0e15\u0e48\u0e07\u0e2d\u0e30\u0e44\u0e23 \u0e01\u0e47\u0e01\u0e33\u0e25\u0e31\u0e07 test \u0e01\u0e31\u0e19\u0e2d\u0e22\u0e39\u0e48 \u0e1c\u0e21\u0e40\u0e2d\u0e32 \u0e27\u0e34\u0e18\u0e35\u0e01\u0e32\u0e23 config \u0e21\u0e32\u0e43\u0e2b\u0e49\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e19 \u0e46 \u0e17\u0e35\u0e48\u0e2a\u0e19\u0e43\u0e08\u0e44\u0e14\u0e49\u0e2d\u0e48\u0e32\u0e19\u0e01\u0e31\u0e19\u0e25\u0e30\u0e01\u0e31\u0e19 \u0e40\u0e1e\u0e23\u0e32\u0e30\u0e27\u0e48\u0e32\u0e01\u0e27\u0e48\u0e32\u0e17\u0e35\u0e48 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,17,15],"tags":[158,967,968,156,157],"class_list":["post-185","post","type-post","status-publish","format-standard","hentry","category-mysql","category-php","category-unix","tag-centos","tag-mysql","tag-php","tag-sphinx","tag-sphinxse"],"_links":{"self":[{"href":"https:\/\/ton.packetlove.com\/blog\/wp-json\/wp\/v2\/posts\/185","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ton.packetlove.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ton.packetlove.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ton.packetlove.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ton.packetlove.com\/blog\/wp-json\/wp\/v2\/comments?post=185"}],"version-history":[{"count":0,"href":"https:\/\/ton.packetlove.com\/blog\/wp-json\/wp\/v2\/posts\/185\/revisions"}],"wp:attachment":[{"href":"https:\/\/ton.packetlove.com\/blog\/wp-json\/wp\/v2\/media?parent=185"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ton.packetlove.com\/blog\/wp-json\/wp\/v2\/categories?post=185"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ton.packetlove.com\/blog\/wp-json\/wp\/v2\/tags?post=185"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}