有没有什么方法可以搜索google驱动器文件的属性?

r9f1avp5  于 2021-07-13  发布在  Java
关注(0)|答案(2)|浏览(380)

我想搜索这样的文件,但我得到例外。

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);

第二个是工作,但有任何功能,以支持通配符?

yhived7q

yhived7q1#

是的,对于自定义属性,必须使用精确值搜索

properties has { key='additionalID' and value='8e8aceg2af2ge72e78' and visibility='PRIVATE' }

https://developers.google.com/drive/web/search-parameters#properties

kmpatx3s

kmpatx3s2#

是的,它在官方文件中(你去年发现它们是不可搜索的)。
https://developers.google.com/drive/web/search-parameters#properties 按精确值搜索。

相关问题