|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-08-14 16:10 UTC] mrdgardiner at gmail dot com
[2012-08-14 16:29 UTC] tony2001@php.net
-Status: Open
+Status: Feedback
[2012-08-14 16:29 UTC] tony2001@php.net
[2012-08-14 16:29 UTC] tony2001@php.net
-Assigned To:
+Assigned To: tony2001
[2012-12-14 09:02 UTC] tony2001@php.net
-Status: Feedback
+Status: No Feedback
[2012-12-14 20:24 UTC] mrdgardiner at gmail dot com
[2012-12-15 11:07 UTC] tony2001@php.net
-Status: No Feedback
+Status: Feedback
[2012-12-15 11:07 UTC] tony2001@php.net
[2013-02-18 00:35 UTC] pecl-dev at lists dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 01:00:01 2025 UTC |
Description: ------------ It appears that Sphinx does not return string attributes using the PHP 1.2.0-1 Sphinx client with Sphinx sphinx-2.0.4-1. Test: 1. setup and install sphinx. 2. Next create a sphinx config with the below details 3. Next using indexer index "phptest" (/usr/local/bin/indexer phptest) 4. Next install PHP 5.3.15 5. Next install Sphinx PHP 1.2.0-1 6. Next libsphinxclient-2.0.4-1 7. Next compile the test php script and execute the test. Test script: --------------- Sphinx Config: source xmlpipe_source { type = xmlpipe2 xmlpipe_command = cat /var/tmp/document1 } index phptest { source = xmlpipe_source path = /var/data/documents docinfo = extern charset_type = utf-8 } Test Documents: /var/tmp/document1 <?xml version="1.0" encoding="utf-8"?> <sphinx:docset> <sphinx:schema> <sphinx:attr name="subject" type="string"/> <sphinx:field name="content"/> <sphinx:attr name="published" type="timestamp"/> </sphinx:schema> <sphinx:document id="9999"> <content>show me the string</content> <published>1012325463</published> <subject>This is the subject</subject> </sphinx:document> <sphinx:document id="1235"> <subject>another subject</subject> <content>here comes another document, and i am given to understand, that in-document field order must not matter, sir</content> <published>1012325467</published> </sphinx:document> </sphinx:docset> PHP Test: php -f test.php Code: <?php $cl = new SphinxClient(); $cl->SetServer( "localhost", 9312 ); $cl->SetMatchMode( SPH_MATCH_ALL ); $result = $cl->Query( 'show me the string', 'phptest' ); if ( $result === false ) { echo "Query failed: " . $cl->GetLastError() . ".\n"; } else { if ( $cl->GetLastWarning() ) { echo "WARNING: " . $cl->GetLastWarning() . " "; } if ( ! empty($result["matches"]) ) { foreach ( $result["matches"] as $doc => $docinfo ) { echo "$doc\n"; } print_r( $result ); } } exit; ?> Expected result: ---------------- [matches] => Array ( [9999] => Array ( [weight] => 4 [attrs] => Array ( [subject] => 'This is the subject' [published] => 1012325463 ) ) ) Actual result: -------------- [matches] => Array ( [9999] => Array ( [weight] => 4 [attrs] => Array ( [subject] => 156595442 [published] => 1012325463 ) ) )