如何使用Google Drive API搜索自定义文件属性?

编程入门 行业动态 更新时间:2024-10-14 14:14:23
本文介绍了如何使用Google Drive API搜索自定义文件属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

Google云端硬盘可让您向文件添加自定义属性( developers. google/drive/v3/web/properties ),但它们不包含在可搜索文本中.

Google Drive allows you to add custom properties to files (developers.google/drive/v3/web/properties), but they aren't included in the searchable text.

来自 developers.google/drive/v3/网络/搜索参数:

fullText string contains Full text of the file including name, description, content, and indexable text.

您只能搜索完全匹配的属性:

You can only search for exact property matches:

appProperties具有{key ='additionalID'和value ='8e8aceg2af2ge72e78'}

appProperties has { key='additionalID' and value='8e8aceg2af2ge72e78' }

还有其他搜索自定义属性的方法吗?

Is there some other way to search the custom properties?

示例:如果我有一个带有自定义属性标签"且值为紧急活动银行"的文件,该如何获取files.list( developers.google/drive/v3/reference/files/list )以在我搜索紧急"时找到此文件?

Example: if I have a file with custom property "tags" and value "active banking urgent", how can I get files.list (developers.google/drive/v3/reference/files/list) to find this file when I search for "urgent"?

推荐答案

这些方法怎么样?不幸的是,它无法使用q灵活地搜索appProperties.因此,为了实现您想要的目标,我提出了以下两种模式.

How about theses methods? Unfortunately, it couldn't find the flexible search for appProperties using q. So in order to achieve what you want to do, I propose the following 2 patterns.

  • 使用files/appProperties作为查询参数检索具有appProperty的文件的列表.
    • GET www.googleapis/drive/v3/files?fields=files%2FappProperties
    • 仅从Google云端硬盘中的所有文件中检索appProperties.
    • Retrieve a list of files which have appProperties using files/appProperties as a query parameter.
      • GET www.googleapis/drive/v3/files?fields=files%2FappProperties
      • Only appProperties from all files on Google Drive is retrieved.
      • 在这种模式下,API的使用计数为2.

        In this pattern, the usage count of APIs are 2.

      • 使用files(appProperties,id,name)作为查询参数检索具有appProperty的文件的列表.
        • GET www.googleapis/drive/v3/files?fields=files(appProperties%2Cid%2Cname)
        • 从Google云端硬盘上的所有文件中检索
        • appProperties,fileId和filename.这些参数以or搜索.
        • Retrieve a list of files which have appProperties using files(appProperties,id,name) as a query parameter.
          • GET www.googleapis/drive/v3/files?fields=files(appProperties%2Cid%2Cname)
          • appProperties, fileId and filename from all files on Google Drive are retrieved. These parameters are searched as or.
          • 在此模式下,API的使用计数为1.

            In this pattern, the usage count of APIs are 1.

            如果这对您没有用,很抱歉.

            If this was not useful for you, I'm sorry.

  • 更多推荐

    如何使用Google Drive API搜索自定义文件属性?

    本文发布于:2023-11-28 16:06:49,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1643069.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:自定义   如何使用   文件属性   Drive   Google

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!