cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more 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: 

[Python SDK | API] Inconsistent results with files_search_v2

[Python SDK | API] Inconsistent results with files_search_v2

gavinho
Explorer | Level 3
Go to solution

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)

 

1 Accepted Solution

Accepted Solutions

iNeil
Dropbox Engineer
Go to solution

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.

View solution in original post

4 Replies 4

iNeil
Dropbox Engineer
Go to solution

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.

iNeil
Dropbox Engineer
Go to solution

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.

gavinho
Explorer | Level 3
Go to solution

Hi @iNeil 

 

Thanks for the response. Confirming that the issue has been resolved. Are you able to share the details around the root cause?

 

iNeil
Dropbox Engineer
Go to solution

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.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    iNeil Dropbox Engineer
  • User avatar
    gavinho Explorer | Level 3
What do Dropbox user levels mean?