为什么我的Faroo API搜索只返回10个结果


Why does my Faroo API search only returns 10 results?

我似乎只收到10个结果,因为当我访问任何超过10的索引时,我会收到一个通知:

注意:未定义的偏移量:第146行上的10 in/home/msc2012/12254822/public_html/safe_dir/safegogle.php

似乎也没有url参数可以让我访问更多的结果,我认为它应该默认为100。

$i=100是Blekko循环中的一个变量,返回100结果

if ($_POST['query'])
    {
        $query = urlencode ($_POST['query']);
        $fullUri = 'http://www.faroo.com/api?  
        q='.$query.'&start=1&length=10&l=en&src=web&f=json&key=';
        echo $fullUri;
        curl_setopt($ch, CURLOPT_URL, $fullUri);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
        $data=curl_exec($ch);
        $js = json_decode($data);
        $o=0;
        foreach ($js -> results as $item)
        {
            $Faroo[$o] = "<h5>Faroo</h5><a href='"{$item->url}'"> 
            {$item->title}</a>
            <p>$item->kwic}</p>";    
            $o++;
        }
    }
?> 

<?php
$agg =  $_POST['agg'];
$m=0;
$j=0;
switch ($agg)
{
    case 'Aggregated':
    while ($m<=$i)
    {
        echo $bing_results[$m];
        echo $Faroo[$m];
        echo $Blekko[$m];
        $m++;
    }         
    case 'Non-Aggregated':
    while ($m<=$i)
    {
        echo $Blekko[$m];
        $m++;
    }
    $m=0;
    while ($m<=$i)
    {
        echo $Faroo[$m];
        $m++;
    }
    $m=0;
    while ($m<=$i)
    {
        echo $bing_results[$m];
        $m++;
    }

您尝试过&start=1&长度=100?

Faroo有默认的Length (default=10; maximum=10)

http://www.faroo.com/hp/api/api.html#parameter