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