napoler / solr-php-client

Automatically exported from code.google.com/p/solr-php-client
Other
0 stars 0 forks source link

ResponseHeader record only last fq #66

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. q=*:*&fq=author:dante&fq=date:1959&
2.
3.

What is the expected output? What do you see instead?

in response->responseHeader->fq => array('author:dante', 'date:1959')

and not response->responseHeader->fq => (string) 'date:1959'

What version of the product are you using? On what operating system?
r60, macosx

Please provide any additional information below.

Original issue reported on code.google.com by marco.pa...@gmail.com on 19 May 2011 at 3:47

GoogleCodeExporter commented 8 years ago
the problem seems to be in the convertion from json: because if I call 
/solr/select in the json response fq is correct (array), but if I print_r 
$response->getRawResponse() fq is string!

Original comment by marco.pa...@gmail.com on 19 May 2011 at 3:53

GoogleCodeExporter commented 8 years ago
The library uses json_decode so I doubt its a bug there. I think more likely, 
there's a difference between your manually called URL and what you're 
generating with the PHP client. Can you make sure your test code is similar to 
this (specifically the construction of the $params):

<?php

$solr = new Apache_Solr_Service();

$params = array(
        // note I have to use an array to pass the same parameter
        // multiple times
        'fq' => array(
                'author:dante',
                'date:1959'
        )
);

try
{
        $response = $solr->search('*:*', 0, 10, $params);

        // here's the JSON
        print_r($response->getRawResponse());

        // here's the fq params as reported by responseHeader
        print_r($response->responseHeader->params->fq);
}
catch (Apache_Solr_HttpTransportException $te)
{
        echo $te->getMessage(), "\n";
        echo $te->getResponse()->getRawResponse(), "\n";
}
?>

Original comment by donovan....@gmail.com on 19 May 2011 at 4:35

GoogleCodeExporter commented 8 years ago
I could not reproduce this issue given the description, and the submitter has 
not yet responded to my comment.

Original comment by donovan....@gmail.com on 20 May 2011 at 12:19

GoogleCodeExporter commented 8 years ago
You can close this issue: the library that call Apache_Solr_Service extract fq 
from query string without split param with same name ($_GET['fq'] return always 
last value).

sorry, next time I'll be more careful
thanks

Original comment by marco.pa...@gmail.com on 20 May 2011 at 3:28