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

  • Royi

    What about LaTeX Rendering in MarkDown documents?

    We really need it for project documentation.

    • Steve King

      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

    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

      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

      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.

      • http://facespace.com FaceSpace

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

  • Chris Carr

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

  • http://facespace.com FaceSpace
  • Jim Bethancourt

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

    • Steve King

      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

      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

    when is the official release for production environments?

    • Raj Sarkar

      It’s coming soon.

  • Mugzy

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

    • Raj Sarkar

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

  • Bill

    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

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

    C’mon, guys! You can do it!

  • http://stefanwrobel.com/ Stefan Wrobel

    Catching up to Github, one feature at a time…