易截截图软件、单文件、免安装、纯绿色、仅160KB

用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 VC9,VC6,Thread Safe,Non Thread Safe

一、如何选择 PHP5.3 的 VC9 版本和 VC6 版本
VC6 版本是使用 Visual Studio 6 编译器编译的,如果你的 PHP 是用 Apache 来架设的,那你就选择 VC6 版本。
VC9 版本是使用 Visual Studio 2008 编译器编译的,如果你的 PHP 是用 IIS 来架设的,那你就选择 VC9 版本。
二、如何选择 PHP5.3 的 Thread Safe 和 Non Thread S ......

[转]续 “创造世界上最简单的 php开发模式”

  “技术问题都是可以解决的,技术问题不是最最重要的”
   最近帮过一些人解决技术问题,发现一个很严重的问题,他们的做法和我最开始写程序的时候是一样的,这样下去会走好多的弯路。现在有一类程序员太多,他们总是一味的追求“所谓的技术难点”,总是把心事放在一些边边角角的“程序代码 ......

php文件上传

//上传文件
$dir="../upfile/jianli";
set_time_limit(0);
extract($_FILES);
if(!empty($res_clett["name"])){
    $upfile=&$HTTP_POST_FILES['con_pdf'];
    $upfileEx=substr($upfile['name'],-3);
    $tmp_name=date("YmdGhis").'.'.$upfileEx;
 &nb ......

php 不支持中文文件名的处理

最近写一个关于读取中文文件名的小CASE中遇到了不PHP不支持中文文件名的问题
我的环境:
WINDOWS+Appach +mysql
php页 MYSQL均为编码UTF-8
解决方法如下:
在MYSQL中取出的中文文件名转换其编码
$fileName=iconv("UTF-8","GBK",$fileName); ......

完整linux下php单服务器配置

操作系统CentOS 5.3
系统安装完成后,安装必要的包
yum install autoconf gcc gcc-c++ libjpeg libjpeg-level
libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号