Code aware search Save time combing through usage results with a semantic search that ranks definitions first over usages or variables names. Sign up for Bitbucket Cloud to take it for a spin.

Get started, it’s free

: Bitbucket Cloud is

public class FastHashMap { /* ... */ }

or

import foo.bar.FastHashMap public class SomeOtherClass { public void doSomething() { FastHashMap fastHashMap = new FastHashMap(); } }

You’d prefer the class definition, right? Let’s take a deeper look at how we built our code aware search to provide the most relevant search results at a fast pace.

How code search works in Bitbucket Cloud

To compare this live, you can search for the common class “QueryBuilders” on the Elasticsearch repo. In GitHub, it shows up as the 6th result on the 18th page (at time of writing). In Bitbucket Cloud, the class definition shows up as the first result.

Languages, f erators

Code aware search outperforms traditional for statically typed languages like Java that tend to repeat type names when importing, declaring, and instantiating types. However Bitbucket Cloud’s code aware search is also highly effective for a range of other popular languages including JavaScript, Python, Ruby, and PHP, among others.

Since code aware search is built for source code, we also index . and _ that are commonly used in identifiers. This means you can get more precise results for compound search terms such as class, function, and variable names like “foo_bar.baz”.

you to restrict search results by using modifiers and operators. You can use modifiers to filter by a particular language or file extension (like “ext:css” or “lang:ruby”) or limit search to specific repos (repo:elasticsearch). Projects can use operators (like AND, OR, and NOT) to narrow down or broaden results in case you get too many.

For a full list of the capabilities and search query considerations with code search in Bitbucket Cloud, check out our documentation.

Try Bitbucket Cloud’s Code Aware Search

Get started, it’s free

Have more specific questions about this post? Reach out to us on Twitter to get the information you need.