Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
We are experiencing inconsistent results with the files_search_v2 function with both the Python SDK and API. An example is if we are searching for a particular file: '/Media Coordination/VERSIONING/Graveyard_Carz_TE00000114/S06/Subs/TE00000114_06_0011_A2_S_FRA.srt'
If we search for a particular string eg. 'TE00000114_06_0011_A2' we are returned a list of results which does not include the file in question:
['/Media Coordination/VERSIONING/Graveyard_Carz_TE00000114/S06/Subs/TE00000114_06_0011_A2_S_NLD.srt', '/Media Coordination/VERSIONING/Graveyard_Carz_TE00000114/S06/Subs/TE00000114_06_0011_A2_CC_ENG.srt', '/Media Coordination/VERSIONING/Graveyard_Carz_TE00000114/S06/Subs/TE00000114_06_0011_A2_S_TUR.srt', '/Media Coordination/VERSIONING/Graveyard_Carz_TE00000114/S06/Subs/TE00000114_06_0011_A2_S_CMN.srt', '/Media Coordination/VERSIONING/Graveyard_Carz_TE00000114/S06/Subs/TE00000114_06_0011_A2_S_CMN_FMT.srt']
If we 'widen' the search to now search for the following string 'TE00000114_06_0011_A', the following and expected results are returned:
['/Media Coordination/VERSIONING/Graveyard_Carz_TE00000114/S06/Subs/TE00000114_06_0011_A2_S_FRA.srt', '/Media Coordination/VERSIONING/Graveyard_Carz_TE00000114/S06/Subs/TE00000114_06_0011_A2_S_NLD.srt', '/Media Coordination/VERSIONING/Graveyard_Carz_TE00000114/S06/Subs/TE00000114_06_0011_A2_CC_ENG.srt', '/Media Coordination/VERSIONING/Graveyard_Carz_TE00000114/S06/Subs/TE00000114_06_0011_A2_S_TUR.srt', '/Media Coordination/VERSIONING/Graveyard_Carz_TE00000114/S06/Subs/TE00000114_06_0011_A2_S_CMN.srt', '/Media Coordination/VERSIONING/Graveyard_Carz_TE00000114/S06/Subs/TE00000114_06_0011_A2_S_CMN_FMT.srt']
A simplified version of the function here:
def dropbox_find_local():
dropbox_vers_path = '/Media Coordination/VERSIONING'
search_string = 'TE00000114_06_0011_A'
sub_ext = '.srt'
def process_entries(entries):
for entry in entries:
metadata = entry.metadata.get_metadata()
local_file = metadata.path_display
local_list.append(local_file)
local_list = []
search_opt = SearchOptions(path=dropbox_vers_path, file_extensions=[sub_ext.lstrip('.')], filename_only=True)
result = dbx.files_search_v2(search_string, options=search_opt)
process_entries(result.matches)
while result.has_more:
result = dbx.files_search_continue_v2(result.cursor)
process_entries(result.matches)
print(local_list)
This same behaviour can be reproduced if we use the web API which uses the same files_search_v2 endpoint:
https://www.dropbox.com/search/work?path=%2FMedia+Coordination%2FVERSIONING&query=TE00000114_06_0011... (Missing results)
https://www.dropbox.com/search/work?path=%2FMedia+Coordination%2FVERSIONING&query=TE00000114_06_0011... (Expected behaviour)
Hi @gavinho,
The engineering team has located and fixed the issue with searching files and folders. Please let us know if you need further assistance with this case.
Hi @gavinho,
Thanks for the report! This case has been escalated to the engineering team. I'll follow up here once I have any updates on this.
Hi @gavinho,
The engineering team has located and fixed the issue with searching files and folders. Please let us know if you need further assistance with this case.
Hi @iNeil
Thanks for the response. Confirming that the issue has been resolved. Are you able to share the details around the root cause?
Hi @gavinho,
Thank you for confirming that the issue is resolved! Unfortunately Iām unable to provide the root cause for this case. However there was an issue with our search functionality that caused inconsistent results.
Hi there!
If you need more help you can view your support options (expected response time for a 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!