php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67708 bug in retrieving "sql_field_string"
Submitted: 2014-07-29 12:20 UTC Modified: 2021-03-03 12:28 UTC
Votes:2
Avg. Score:4.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (50.0%)
From: anas1305 at gmail dot com Assigned:
Status: Suspended Package: sphinx (PECL)
PHP Version: Irrelevant OS: Windows 7
Private report: No CVE-ID: None
 [2014-07-29 12:20 UTC] anas1305 at gmail dot com
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
                )

        )

)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-07-17 14:44 UTC] cheung dot jackey at gmail dot com
PHP 5.3.29
Windows 7 x64
Sphinx 2.2.9-release
PECL sphinx 1.3.3

Same issue occurs
 [2021-03-03 12:28 UTC] cmb@php.net
-Status: Open +Status: Suspended
 [2021-03-03 12:28 UTC] cmb@php.net
The sphinx package is no longer maintained.  So I suspend this
ticket, until a new maintainer steps up.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 06:01:30 2024 UTC