cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to know what we learned at IBC? Check out our learnings on media, remote working and more right here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Re: Java API search not including PropertyGroups

Java API search not including PropertyGroups

tartarian
Explorer | Level 4
Go to solution

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

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

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.

View solution in original post

5 Replies 5

Greg-DB
Dropbox Staff
Go to solution

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.

tartarian
Explorer | Level 4
Go to solution

Hi Greg,

Is it only the Java implementation that doesn't include property groups or is it the same for all APIs? I noticed that the HTTP API shows an example result that includes the property_groups but it sounds like that might just be a mistake. https://www.dropbox.com/developers/documentation/http/documentation#files-search

 

Regards

Greg-DB
Dropbox Staff
Go to solution

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
Explorer | Level 4
Go to solution

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
Dropbox Staff
Go to solution

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. 

Need more support?