0
source logs
{
type = mysql
sql_host = localhost
sql_user = root
sql_pass =
sql_db = bot
sql_port = 3306
sql_query_pre = SET NAMES utf8
sql_query = SELECT * FROM logs
sql_attr_uint = host
sql_query_info = SELECT * FROM logs WHERE id=$id
}
index logs
{
source = logs
path = D:\Webserver/Sphinx/index/logs
morphology = stem_ru, stem_en
min_word_len = 1
charset_type = utf-8
}
searchd
{
listen = 9312
log = D:\Webserver/Sphinx/log/searchd.log
query_log = D:\Webserver/Sphinx/log/query.log
pid_file = D:\Webserver/Sphinx/log/searchd.pid
}
我的數據庫:獅身人面像MySQL查詢問題
ID | HOST | POST | URL
1 | yahoo.com | *js3s7Hs56 | http://yahoo.com
2 | google.com | 7sf6jsg73 | http://google.com/?asfaa=23
PHP代碼獅身人面像(搜索)
<?php
include('sphinxapi.php');
$cl = new SphinxClient();
$cl->SetServer("localhost", 9312);
$cl->SetMatchMode(SPH_MATCH_ANY );
$result = $cl->Query("google");
if ($result === false)
{
echo "Query failed: " . $cl->GetLastError() . ".\n";
}
else
{
print_r($result);
}
將返回此代碼:
2
正如現在我使用獅身人面像撤回所有數據ID 2 ??
對不起,我的英文不好
謝謝..我想在獅身人面像它的功能 – Isis 2010-10-16 00:34:19