易截截图软件、单文件、免安装、纯绿色、仅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 不支持中文文件名的处理

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

了解如何使用 PHP 的各种文件函数

发信人: feuvan ( }><(([@> ~ ), 信区: PHP
标  题: [入门]用 PHP 读取文件的正确方法
发信站: 水木社区 (Wed Mar  7 17:51:58 2007), 站内
http://www.ibm.com/developerworks/cn/opensource/os-php-re ......

PHP通过DOM操作XML

PHP XML操作类DOMDocument属性及方法
注意大小写一定不能弄错.
属性:
Attributes 存储节点的属性列表(只读)
childNodes 存储节点的子节点列表(只读)
dataType 返回此节点的数据类型
Definition 以DTD或XML模式给出的节点的定义(只读)
Doctype 指定文档类型节点(只读)
documentElement 返回文档的根元素(可读写)
fi ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号