Introducing code search for Bitbucket Server

By on March 24, 2016

How often has this happened to you: you see an error message and you’re not sure which part of the code it came from, or you know the function name but you don’t know what repo contains the code for it. “Ghaah!” Many of you’ve been asking for a way to search through your code in Bitbucket Server, and I’m pleased to tell you that the wait is over.

Today, we’re inviting our customers to take a first look at code search in Bitbucket Server via our early access program (EAP). Now you can search through your code to find exactly what you’re looking for right from the search bar:

search-bar-crop


How does it work?

We understand that many of your teams have a lot of code. So we’ve made it easy for you to restrict your search results to a specific project or repository using search filters. You can also search for code in a particular language (e.g., lang:java) or with a particular file extension (e.g., ext:css).

dialog2-crop

Search operators like AND, OR, and NOT can be added to searches to help narrow down or broaden the results. This is useful for further filtering results when you get too many.

giraffe-monkey-crop

How do I get started?
Glad you asked! You can download the Bitbucket Server EAP build with code search here and we’ve created this step by step guide to get you started. If you do try it out, let us know how it goes – your feedback is extremely valuable to us. Filling out this short and simple survey will help us make code search installation better for you and your fellow Bitbucketeers when it is officially released.

We look forward to bringing you more soon. Happy searching!

Download code search EAP now

19 Comments

  • Royi
    Posted March 24, 2016 at 8:27 am | Permalink

    What about LaTeX Rendering in MarkDown documents?

    We really need it for project documentation.

    • Steve King
      Posted March 28, 2016 at 10:26 pm | Permalink

      Hi Royi, we don’t currently support searching of the rendered result from documents but you can search the raw file. For supporting the rendering of LaTeX files inside Bitbucket Server, feel free to raise feature request so that we can look into it.

  • Robert Watkins
    Posted March 24, 2016 at 2:38 pm | Permalink

    And we can expect this in Bitbucket Cloud (you know, the real Bitbucket) when? Or is this going to be another feature that’s only in Stash?

    More seriously – what does this give me over a simple grep of my checked out code base? All of the examples look like it’s only searching the HEAD – can it find references on a branch that haven’t been merged in yet? Can it find references to code that’s been deleted?

    • Raj Sarkar
      Posted March 25, 2016 at 7:17 am | Permalink

      We’re excited that we’ve finally delivered code search to Bitbucket Server customers, and we know our cloud customers are also interested in the functionality. Thanks for the feedback, and we’ll share an update as soon as we have one!

    • Jens Schumacher
      Posted March 25, 2016 at 10:00 am | Permalink

      As Raj mentioned, we have plans to bring search to Bitbucket Cloud and working on making it scale for millions of users and repositories.

      You are correct that Code Search only searches the HEAD of the repository at this stage. However, the benefit over grep is that it searches across all your repositories in Bitbucket, not just the ones you have cloned locally. A number of use-cases are:

      – Find the source for a dependency
      – Find the source for an error message or stack trace
      – Find a particular method, or where it’s being used
      – Explore code within your company. For example who has worked on anything User Management related.

      • Posted March 26, 2016 at 2:34 pm | Permalink

        How long have you had these plans for? 5 years?

  • Chris Carr
    Posted March 26, 2016 at 6:49 am | Permalink

    This is great news. Looking forward to trying it out. Thanks for your hard work!

  • Posted March 26, 2016 at 2:34 pm | Permalink
  • Jim Bethancourt
    Posted March 28, 2016 at 12:27 pm | Permalink

    Will there be a mechanism to interact with the search index from within Bitbucket plugins?

    • Steve King
      Posted March 28, 2016 at 10:41 pm | Permalink

      Hi Jim, that’s certainly something we are aware people will want to do. If you’re interested, please raise a request on jira.atlassian.com and I’d be happy to follow it up with you.

    • ssaasen
      Posted March 29, 2016 at 3:13 am | Permalink

      We haven’t yet exposed an API for plugins to consume.

      How would you expect to interact with the search index from within a plugin? Do you have specific use cases in mind?

  • Jay
    Posted April 30, 2016 at 5:21 am | Permalink

    when is the official release for production environments?

    • Raj Sarkar
      Posted April 30, 2016 at 7:51 am | Permalink

      It’s coming soon.

  • Mugzy
    Posted May 5, 2016 at 8:18 am | Permalink

    Any updates on when bitbucket cloud customers will get this new feature?

    • Raj Sarkar
      Posted May 5, 2016 at 9:23 am | Permalink

      see below – we have plans to bring search to Bitbucket Cloud

  • Bill
    Posted July 8, 2016 at 6:24 am | Permalink

    Hi, this feature is key to compete with FogBugz Kiln offering. I am glad you are working on it. Can you please provide an update on delivery for cloud now that it is 3 months later?

  • Steel Rat
    Posted July 24, 2016 at 3:42 pm | Permalink

    I’m SO SURPRISED that this is not done yet!

    C’mon, guys! You can do it!

  • Posted August 19, 2016 at 5:02 pm | Permalink

    Catching up to Github, one feature at a time…