|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-07-17 14:44 UTC] cheung dot jackey at gmail dot com
[2021-03-03 12:28 UTC] cmb@php.net
-Status: Open
+Status: Suspended
[2021-03-03 12:28 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 06:00:01 2025 UTC |
Description: ------------ The "sql_field_string" defined in "sphinx.conf" does not return the expected string but return a number instead. But it work if I use "search.exe" tool in cli mode or the "sphinxapi.php" provided in sphinx package. Used Versions : - PHP : 5.4.16 (Wampserver 2.4) - sphinx : Sphinx 2.1.9-release (r4761) - pecl sphinx : 1.3.2 & 1.3.1 (5.4 Thread Safe (TS) x86) Test script: --------------- - In "sphinx.conf" : source documents : base { .... sql_query = SELECT `id`, `title` FROM `documents` sql_field_string = title } index documents { source = documents path = C:\Sphinx\var\data\documents dict = keywords min_infix_len = 3 charset_type = utf-8 } -> I use the "example.sql" in the sphinx package. // In "sphinx_test.php" : $s = new SphinxClient(); $s->setServer("localhost", 9312); $result = $s->query('test', 'documents'); print_r($result); Expected result: ---------------- Array ( [error] => [warning] => [status] => 0 [fields] => Array ( [0] => title ) [attrs] => Array ( [title] => 7 ) [matches] => Array ( [1] => Array ( [weight] => 1 [attrs] => Array ( [title] => test one <------ this one ) ) [2] => Array ( [weight] => 1 [attrs] => Array ( [title] => test two <------ this one ) ) ) [total] => 2 [total_found] => 2 [time] => 0.015 [words] => Array ( [test] => Array ( [docs] => 2 [hits] => 2 ) ) ) Actual result: -------------- Array ( [error] => [warning] => [status] => 0 [fields] => Array ( [0] => title ) [attrs] => Array ( [title] => 7 ) [matches] => Array ( [1] => Array ( [weight] => 1 [attrs] => Array ( [title] => 46017541 <-------- ) ) [2] => Array ( [weight] => 1 [attrs] => Array ( [title] => 46017561 <------------- ) ) ) [total] => 2 [total_found] => 2 [time] => 0 [words] => Array ( [test] => Array ( [docs] => 2 [hits] => 2 ) ) )