Uploaded image for project: 'Bitbucket Cloud'
  1. Bitbucket Cloud
  2. BCLOUD-22875

Code Search API don't return more than 1000 results

XMLWordPrintable

      Issue Summary

      This is reproducible on Data Center: no

      Steps to Reproduce

      1. Hit the API below trying to fetch all Code Search results:
        • $ curl 'https://api.bitbucket.org/2.0/workspaces/workspace_slug_or_uuid/search/code?search_query='<example>'&pagelen=1001
          

      Expected Results

      All results above 1000 should be returned.

      Actual Results

      All results above 1000 are not returned.

      Workaround

      The current workaround is to add a filter for the repository/project inside the workspace, this way the result will return less than 1000 results. Or execute multiple API calls with less pagelen:

      $ curl 'https://api.bitbucket.org/2.0/workspaces/workspace_slug_or_uuid/search/code?search_query='<example>'&pagelen=100&page=1
      
      $ curl 'https://api.bitbucket.org/2.0/workspaces/workspace_slug_or_uuid/search/code?search_query='<example>'&pagelen=100&page=2
      
      $ curl 'https://api.bitbucket.org/2.0/workspaces/workspace_slug_or_uuid/search/code?search_query='<example>'&pagelen=100&page=3
      

              Unassigned Unassigned
              cacdc2da5150 Alan R
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: