We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.

Forum Discussion

tartarian's avatar
tartarian
Explorer | Level 4
5 years ago

Java API search not including PropertyGroups

Hello, I'm trying to use the Java API to search for files and to leverage PropertyFields as custom "tagged info" on each file. I've noticed that the search results don't include any PropertyGroups (well an empty collection is returned, which is different to not being included at all and quite confusing). Currently the only way for me to search for files and also display their custom PropertyFields is to do a search, and then for each result specifically download the metadata again including the PropertyGroups. This double handling seems very excessive and is slow, is there any better way to achieve what I'm doing? Can the search be configured to include PropertyGroups?


Regards

  • No, unfortunately searchV2 doesn't offer a way to include file properties in the results like this, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though. 

     

    There is a propertiesSearch method, if that helps for your use case, but note that only allows you to directly search for files with a specific file property value, and not, say, a filename like you can with the normal search functionality.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    No, unfortunately searchV2 doesn't offer a way to include file properties in the results like this, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though. 

     

    There is a propertiesSearch method, if that helps for your use case, but note that only allows you to directly search for files with a specific file property value, and not, say, a filename like you can with the normal search functionality.

      • Greg-DB's avatar
        Greg-DB
        Icon for Dropbox Staff rankDropbox Staff

        The Java SDK (and the rest of the SDKs) all use the same HTTP API. The example in the documentation for the HTTP API itself is incorrect in this case. (The documentation sometimes re-uses example objects across endpoints, which in this case is wrong because the example happens to include 'property_groups', though the search endpoint itself doesn't actually have an option to include that in reality.) I'll ask the team to fix that up in the documentation. Thanks for pointing that out!

    • tartarian's avatar
      tartarian
      Explorer | Level 4

      Hi Greg,

      Thanks for the help, I've got one more question. With the propertiesSearch method, I see it looks for specific file property values with the PropertySearchQuery but it also requires a PropertySearchMode, which itself requires the field name. So I need both the name/value pair to search. Considering that a PropertyGroup cannot contain more than 1 item with the same name, and because it's not a wildcard search meaning one long delimited string as the value isn't possible, I can't see a way to make multiple metadata tags useable and searchable. Does this sound right, is there anything I'm missing?

       

      EDIT: what I can see is that the propertiesSearch can take a list of PropertiesSearchQuery's, should I be creating say 5 queries for 5 different named fields, always search all 5 and then limit the maximum number of tags on the front end to 5 as well? As far as I understand the current design means a template needs to be created for every single tag, is that correct?

      Regards 

      • Greg-DB's avatar
        Greg-DB
        Icon for Dropbox Staff rankDropbox Staff

        Yes, it sounds like you have this all correct, except that, if I understand your use case correctly, you shouldn't have to create multiple templates. A single template can have multiple fields, so you could create the, for instance, 5 different tag fields, like you mentioned, but on the same template. 

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,877 PostsLatest Activity: 12 months ago
325 Following

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!