2012-04-25 1 views
0

こんにちは、私はWAMP環境でスフィンクス検索を設定しようとしました。スフィンクスの検索は私のワーム環境では機能していませんか?

これは私が結果を示しているコマンドプロンプト検索テキストを通じ、APIフォルダ

<?php 
$searchName = "food"; 
require_once('sphinxapi.php'); 
//Sphinx 
$s = new SphinxClient(); 
$s->setServer("localhost", 8080); 
$s->setMatchMode(SPH_MATCH_EXTENDED2); 
$result = $s->query("@searchtext $searchName"); 
print_r($result); 

?> 

内のphpファイルのこの種を作成した私のsphinx.confファイル

# 
# Minimal Sphinx configuration sample (clean, simple, functional) 
# 

source combinedobject 
{ 
    type   = mysql 

    sql_host  = localhost 
    sql_user  = root 
    sql_pass  = root 
    sql_db   = digi_inter 
    sql_port  = 3306 # optional, default is 3306 

    sql_query  = \ 
     SELECT file_id, file_idas int_attr, object_type_id, searchtext from image_gallery ; 

    sql_attr_uint   = int_attr 
    sql_attr_uint   = object_type_id 
    sql_field_string  = searchtext 

    sql_query_info  = SELECT * FROM image_gallery WHERE file_id=$id 
} 


index combinedobject 
{ 
    source   = combinedobject 
    path   = D:\PHP_Projects\DigiInternational\sphinx\data\combinedobject 
    docinfo   = extern 
    charset_type = sbcs 
} 



indexer 
{ 
    mem_limit  = 32M 
} 


searchd 
{ 
    listen   = 9312 
    log    = D:\PHP_Projects\DigiInternational\sphinx\log\searchd.log 
    query_log  = D:\PHP_Projects\DigiInternational\sphinx\log\query.log 
    pid_file  = D:\PHP_Projects\DigiInternational\sphinx\log\searchd.pid 
    max_matches  = 1000 
    compat_sphinxql_magics = 1 
} 

です。しかし、file_idとobject_type_idは結果を表示しません。

PHPを使用すると何も表示されません。私のsphinxバージョンはsphinx-0.9.8-win32です。どんな体でも私を喜ばせることができます。

ありがとうございました

+0

print_r($ s-> showLastError())とは何ですか;ショー? – barryhunter

答えて

1

Ah!サーバーはポート9312でリッスンしています

listen   = 9312 

なぜ8080に接続しようとしますか?

$s->setServer("localhost", 8080); 
関連する問題