Customer services - Infrared Sauna - Wordpress Themes - Loan - Play Piano by Ear

PDA

View Full Version : filtering problem


Epsilon
Mar 26th 2004, 6:35 am
Hello,

I've got a problem with the "filter" attribute of the search request.

The "documentFiltering" of the results is always set to "false", even
when filtering should be performed (when testing with the same query
on other google-api engines).

And the "hostName" of the search results is always empty.

So it doesn't seems to work, but filter is correctly set to true !

I don't understand. I asked others php coders, and with the same code
it works with them. (even if I noticed that filtering doesn't work too
on some website using google-api, I'm not alone).

Here's my code (in PHP) :

$parameters = array(
"key" => $key,
"q" => $Query,
"start" => $start,
"maxResults" => $maxResults,
"filter" => true,
"restrict" => $restrict,
"safeSearch" => true,
"lr" => $lg,
"ie" => "",
"oe" => ""
);
$soapclient = new soapclient("http://api.google.com/search/beta2");
$result = $soapclient->call("doGoogleSearch", $parameters,
"urn:GoogleSearch");

I saw in an other post that someone had the same problem, and I changed nusoap.php like indicated :

if ($uqType == 'boolean' && !$value) {
$value = 'false';
} elseif ($uqType == 'boolean') {
$value = 'true';
}

But it still doesn't work

Can you help me please ?

Thanks
Epsilon

Epsilon
Mar 26th 2004, 7:08 am
Hmm I fixed the problem:

nusoap.php, line 0223:

replace
case (is_bool($val) || $type == 'boolean'):
if(!$val){
$val = 0;
}

by

case (is_bool($val) || $type == 'boolean'):
if(!$val){
$val = 'false';
}
else $val = 'true';

digitalpoint
Mar 26th 2004, 8:27 am
I think it must be a common issue with nusoap, because someone else had the same problem shown here.

- Shawn