Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 在google drive api中使用全文字段_Php_Google Api Php Client - Fatal编程技术网

Php 在google drive api中使用全文字段

Php 在google drive api中使用全文字段,php,google-api-php-client,Php,Google Api Php Client,我遇到了google drive API的问题。 我下载了带有composer的库,它安装正确,似乎可以工作。当我尝试在文件标题或MIMTYPE上搜索我的驱动器时,效果很好,但是当我想使用全文字段时,它失败了,错误如下 Fatal error: Uncaught exception 'Google_Service_Exception' with message 'Error calling GET https://www.googleapis.com/drive/v2/files?q=fullT

我遇到了google drive API的问题。 我下载了带有composer的库,它安装正确,似乎可以工作。当我尝试在文件标题或MIMTYPE上搜索我的驱动器时,效果很好,但是当我想使用全文字段时,它失败了,错误如下

Fatal error: Uncaught exception 'Google_Service_Exception' with message 'Error calling GET https://www.googleapis.com/drive/v2/files?q=fullText%3D%27Werken+met+procestaken+op+een+klant+project%27: (400) Invalid query'
我的代码

function searchFile($query,$service){
    $pageToken = null;
    do {
        $response = $service->files->listFiles(array(
            'q' => "fullText='".$query."'",
        ));
        foreach ($response->items as $file) {
            printf("Bestand gevonden: %s (%s)\n", $file->title, $file->id);
        }
    } while ($pageToken != null);
}

我做错了。下面是它的工作原理。也许将来它能帮助一些人

function searchFile($query,$service){
    $pageToken = null;
    do {
        $response = $service->files->listFiles(array(
          'corpus' => 'DEFAULT',
          'q' => "fullText contains '".$query."'",
         ));

    foreach ($response->items as $file) {
        printf("Bestand gevonden: %s (%s)\n", $file->title, $file->id);
    }
  } while ($pageToken != null);
}

我做错了。下面是它的工作原理。也许将来它能帮助一些人

function searchFile($query,$service){
    $pageToken = null;
    do {
        $response = $service->files->listFiles(array(
          'corpus' => 'DEFAULT',
          'q' => "fullText contains '".$query."'",
         ));

    foreach ($response->items as $file) {
        printf("Bestand gevonden: %s (%s)\n", $file->title, $file->id);
    }
  } while ($pageToken != null);
}