有什么方法可以在 google 驱动器文件的属性中搜索吗?
Is there any way to search in the properties of google drive files?
我想像这样搜索文件,但出现异常。
query = "mimeType ='application/pdf' and properties has { key="+ "'" + agency + "'" +"and value contains"+ "'" + someValue + "'" + " and visibility='PUBLIC'} ";
request = service.files().list().setQ(query);
我们需要按精确值搜索吗?
query = "mimeType ='application/pdf' and properties has { key="+ "'" + agency + "'" +"and value = "+ "'" + someValue + "'" + " and visibility='PUBLIC'} ";
request = service.files().list().setQ(query);
第二个可以,但是有什么功能支持通配符吗?
是的,它在官方文档中(你去年无法搜索到它们)。
https://developers.google.com/drive/web/search-parameters#properties 按精确值搜索。
是的,对于自定义属性,您必须使用精确值进行搜索
properties has { key='additionalID' and value='8e8aceg2af2ge72e78' and visibility='PRIVATE' }
https://developers.google.com/drive/web/search-parameters#properties
我想像这样搜索文件,但出现异常。
query = "mimeType ='application/pdf' and properties has { key="+ "'" + agency + "'" +"and value contains"+ "'" + someValue + "'" + " and visibility='PUBLIC'} ";
request = service.files().list().setQ(query);
我们需要按精确值搜索吗?
query = "mimeType ='application/pdf' and properties has { key="+ "'" + agency + "'" +"and value = "+ "'" + someValue + "'" + " and visibility='PUBLIC'} ";
request = service.files().list().setQ(query);
第二个可以,但是有什么功能支持通配符吗?
是的,它在官方文档中(你去年无法搜索到它们)。
https://developers.google.com/drive/web/search-parameters#properties 按精确值搜索。
是的,对于自定义属性,您必须使用精确值进行搜索
properties has { key='additionalID' and value='8e8aceg2af2ge72e78' and visibility='PRIVATE' }
https://developers.google.com/drive/web/search-parameters#properties