我已经使用 GCP 服务帐户集成了 Google Drive API 来获取文件,当我在父文件夹内搜索任何关键字时,它会给出准确的结果,但当搜索在子文件夹内进行时,结果与 Google Drive 搜索结果不匹配。我已经尝试过了
corpora:'allDrives',
includeTeamDriveItemsRequired:true,
includeItemsFromAllDrives:true,
supportsAllDrives:true,
下面是我的代码
const driveRes = await driveService.files.list({
q: "trashed=false and ('1QLOnVfHvt_M6P8PGTI5z58IjcYXnIFD8' in parents ) and fullText contains 'analytical'",
fields: 'nextPageToken, files(id, name, mimeType, parents, createdTime, modifiedTime, thumbnailLink)',
spaces: 'drive',
pageSize: pageSize,
pageToken: pageToken,
});
console.log('get-drive-files-impl.searchFileFolderWithContent: ', driveRes.data.files.length); // THIS GIVES 6
驱动搜索结果
尝试调整括号或将它们全部删除。
q: "trashed=false and '1QLOnVfHvt_M6P8PGTI5z58IjcYXnIFD8' in parents and fullText contains 'analytical' ",