ÓÃPHP¹¹½¨×Ô¶¨ÒåËÑË÷ÒýÇæSphinx
1. ´´½¨Ë÷Òý
$ sudo /usr/local/bin/indexer --config /usr/local/etc/sphinx.conf --all
Sphinx 0.9.7
Copyright (c) 2001-2007, Andrew Aksyonoff
using config file '/usr/local/etc/sphinx.conf'...
indexing index 'catalog'...
collected 8 docs, 0.0 MB
sorted 0.0 Mhits, 82.8% done
total 8 docs, 149 bytes
total 0.010 sec, 14900.00 bytes/sec, 800.00 docs/sec
2. search ²âÊÔË÷Òý
$ /usr/local/bin/search --config /usr/local/etc/sphinx.conf ENG
Sphinx 0.9.7
Copyright (c) 2001-2007, Andrew Aksyonoff
index 'catalog': query 'ENG ': returned 2 matches of 2 total in 0.000 sec
displaying matches:
1. document=8, weight=1, assembly=5, model=7
id=8
partno=ENG088
descrīption=Cylinder head
price=55
2. document=9, weight=1, assembly=5, model=3
id=9
partno=ENG976
descrīption=Large cylinder head
price=65
words:
1. 'eng': 2 documents, 2 hits
$ /usr/local/bin/search --config /usr/local/etc/sphinx.conf wind
Sphinx 0.9.7
Copyright (c) 2001-2007, Andrew Aksyonoff
index 'catalog': query 'wind ': returned 2 matches of 2 total in 0.000 sec
displaying matches:
1. document=1, weight=1, assembly=3, model=1
id=1
partno=WIN408
descrīption=Portal window
price=423
2. document=5, weight=1, assembly=3, model=1
id=5
partno=WIN958
descrīption=Windshield, front
price=500
words:
1. 'wind': 2 documents, 2 hits
$ /usr/local/bin/search \
--config /usr/local/etc/sphinx.conf --filter model 3 ENG
Sphinx 0.9.7
Copyright (c) 2001-2007, Andrew Aksyonoff
index 'catalog': query 'ENG ': returned 1 matches of 1 total in 0.000 sec
displaying matches:
1. document=9, weight=1, assembly=5, model=3
id=9
partno=ENG976
descrīption=Large cylinder head
price=65
words:
1. 'eng': 2 documents, 2 hits
PHPµ÷ÓÃSphinxËÑË÷ÒýÇæ
£¼?php
include('sphinx-0.9.7/api/sphinxapi.php');
$cl = new SphinxClient();
$cl->SetServer( "localhost", 3312 );
$cl->SetMatchMode( SPH_MATCH_ANY );
$cl->SetFilter( 'model', array( 3 ) );
$result = $cl->Query( 'cylind
Ïà¹ØÎĵµ£º
<?php
//
// Function: »ñȡԶ³ÌͼƬ²¢°ÑËü±£´æµ½±¾µØ
//
//
// È·¶¨ÄúÓаÑÎļþдÈë±¾µØ·þÎñÆ÷µÄȨÏÞ
//
//
// ±äÁ¿ËµÃ÷:
// $url ÊÇÔ¶³ÌͼƬµÄÍêÕûURLµØÖ·£¬²»ÄÜΪ¿Õ¡£
// $filename ÊÇ¿ÉÑ¡±äÁ¿: Èç¹ûΪ¿Õ£¬±¾µØÎļþÃû½«»ùÓÚʱ¼äºÍÈÕÆÚ
// ×Ô¶¯Éú³É.
function GrabImage($url,$filename="") { ......
ʲôÊÇPHP
¡¡¡¡PHP´ú±íÁË"³¬Îı¾´¦ÀíÆ÷"£¬ÕâÒâζ×ÅÄã±ØÐëÖªµÀ£¬ËüÊÇÒ»ÖÖ·þÎñÆ÷¶ËµÄ´¦ÀíÓïÑÔ£¬ÇÒÒÔHTMLµÄÐÎʽ³öÏÖ¡£Ëü×î³£Óõĵط½¾ÍÊÇÍøÒ³ÁË£¬Êý¾Ý´Ó¿Í»§»ú·¢Ë͵½Web·þÎñÆ÷£¬ÐÅÏ¢Ôڴ˱»´¦Àí²¢·µ»Ø½á¹û¡£
¡¡¡¡µ«ÕâÖÖͨÓÃÐÔµÄÓïÑÔË¿ºÁ²»¾ÖÏÞÓÚÔÚÍøÒ³·½Ã棬PHPÒ²Äܱ»ÓÃÔÚÃüÁîÐÐshellÖУ¬Ëü¿É×÷Ϊ²Ù×÷ϵͳµÄÒ»¸öÀ©Õ¹£¬ÓÉ´ËÖ´Ð ......
HTML:
<META HTTP-EQUIV="pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
<META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT">
<META HTTP-EQUIV="expires" CONTENT="0">
PHP£º
header("Expires: Mon, 26 Jul 1997 ......
Ò»¡¢ ÒýÑÔ
¡¡¡¡PHPÊÇÒ»ÖÖÁ¦Á¿Ç¿´óµ«Ï൱ÈÝÒ×ѧϰµÄ·þÎñÆ÷¶Ë½Å±¾ÓïÑÔ£¬¼´Ê¹ÊǾÑé²»¶àµÄ³ÌÐòÔ±Ò²Äܹ»Ê¹ÓÃËüÀ´´´½¨¸´ÔӵĶ¯Ì¬µÄwebÕ¾µã¡£È»¶ø£¬ËüÔÚʵÏÖÒòÌØÍø·þÎñµÄÃØÃܺͰ²È«·½ÃæÈ´³£³£´æÔÚÐí¶àÀ§ÄÑ¡£ÔÚ±¾ÏµÁÐÎÄÕÂÖУ¬ÎÒÃǽ«Ïò¶ÁÕß½éÉܽøÐÐweb¿ª·¢Ëù±ØÐèµÄ°²È«±³¾°ÒÔ¼°PHPÌØ¶¨µÄ֪ʶºÍ´úÂë-Äã¿ÉÒÔ½èÒÔ±£»¤Äã×Ô¼ºµÄwebÓ¦Óó ......
Ò»¡¢ ½¨Á¢Ò»¸ö°²È«³éÏó²ã
¡¡¡¡ÎÒÃDz¢²»½¨ÒéÄãÊÖ¹¤µØ°ÑÇ°Ãæ½éÉܵļ¼ÊõÓ¦ÓÃÓÚÿһ¸öÓû§ÊäÈëµÄʵÀýÖУ¬¶øÊÇÇ¿ÁÒÍÆ¼öÄãΪ´Ë´´½¨Ò»¸ö³éÏó²ã¡£Ò»¸ö¼òµ¥µÄ³éÏóÊǰÑÄãµÄУÑé·½°¸¼ÓÈëµ½Ò»¸öº¯ÊýÖУ¬²¢ÇÒÕë¶ÔÓû§ÊäÈëµÄÿһÏîµ÷ÓÃÕâ¸öº¯Êý¡£µ±È»£¬ÎÒÃÇ»¹¿ÉÒÔ´´½¨Ò»ÖÖ¸ü¸´Ôӵĸü¸ßÒ»¼¶µÄ³éÏó-°ÑÒ»¸ö°²È«µÄ²éѯ·â×°µ½Ò»¸öÀàÖУ¬´Ó¶øÓ¦ ......