如题所述
ä¸. å®è£ ãé ç½®
1.ubuntuå®è£ sphinx
å¦æ没æå®è£ aptitude ,éè¦å å®è£ aptitude
2.é ç½®
3.æ§è¡å½ä»¤åè¯,ä¼å¨/var/lib/sphinxsearch/data/test1 ç®å½ä¸çæä¸å ç´¢å¼æ件
sudo indexer -c /etc/sphinxsearch/sphinx.conf test1
test1为ä¸è¿°é ç½®æ件çindexåå
4.å½ä»¤è¡æµè¯æç´¢
sudo search -c /etc/sphinxsearch/sphinx.conf google
äº.å¨phpä¸ä½¿ç¨ï¼å®è£ phpãsphinxçä¾èµåº
å®è£ aptitudeapt-get install aptitude
sudo aptitude install libsphinxclient-dev libsphinxclient-0.0.1 -y
2.å®è£ php sphinxçæ©å±
å®è£
pecl
sudo apt-get install php-pear php5-dev
å¨å®è£
sphinx
sudo pecl install sphinx
3.å¨é ç½®æ件php.iniä¸æ·»å sphinxçæ©å±,
æçphp.iniæ件为
sudo vim /etc/php5/fpm/php.ini
è·åèªå·±çphp.iniæ件ä½ç½®ä½¿ç¨
php5-fpm -i|grep ini
æ·»å :
extension=sphinx.so
4.éå¯php5-fpm,æ¥çphpæ¯å¦å è½½sphinx模å
sudo /etc/init.d/php5-fpm restart
5.å°searchç¨åºè¿è¡å¨åå°
sudo searchd -c /etc/sphinxsearch/sphinx.conf
é»è®¤çå¬é
ç½®æ件ä¸ç端å£:9312
6.å¨thinkphpä¸è°ç¨æç´¢
æç´¢å®æ¯ï¼è¿åç»æ(é»è®¤è¿å20æ¡,ä¿®æ¹è¿åæ¡æ°ç¨æ·»å $s->SetLimits(0, 1000, 1000);)ï¼æç´¢é度ç¸å½å¿«ï¼ç´¢å¼80wæ¡æ°æ®çtitleådescription两个å段èæ¶ä¸å°10sï¼è¯¥æç´¢å¼ææ¯æå¢éç´¢å¼ï¼å¤ç§æ¨¡å¼çæç´¢ï¼ç½ä¸çèµæä¹é常å¤