Kiln’s search feature is designed so that you can quickly find what you’re looking for in Kiln and navigate around your code with ease.

There are three basic types of search results available in Kiln: Changesets, Filenames, and Code results.

Changesets

Kiln gives you the ability to search through commit messages in a repository to find the exact changeset you’re looking for. For instance, if you’re looking for that changeset where you made changes to the vnode struct, you could search for vnode and you’d end up seeing something like this:

alt text

But changeset search goes even further. If we want to narrow these results by changeset author, say myself, I can filter by username by adding author:Andrew into my search query.

alt text

Ta-da! I’ve restricted my results from the first search in order to find only the changes that I’ve made.

But over time, there could be hundreds of changesets authored by me, and many of them could contain similar words. Thankfully, we can tell Kiln to only look for changesets within a certain date range. For instance, if I want to find all the builds our awesome build manager has tagged in the last month (Oct 2011), all I need to do is search added tag author:rock date:2011-10-01..2011-10-31 and the changes I’m looking for are right in front of me.

kiln_date_search_help

Filenames

Often, you’ll want to go into Kiln and look at a file’s history or you’ll want to view the contents of a file you don’t have cloned to your computer. File search is meant to get you to the file you’re looking for without having to navigate the repository file tree. If I want to double-check how a specific function works in our kiln Mercurial extension, searching for kiln.py brings up the file I’m looking for. From here, I can annotate the file, view the history, or just look at the file contents. It’s that simple!

alt text

Code

One of the most powerful features of Kiln Search is the ability to search for items inside your code. For example, if I am looking for the noConflict function in jQuery, I can simply search for “noConflict” and immediately see where that function is defined and referenced (notice in the screenshot that I have selected “Code” as my result type, which hides results for Changesets that contain the term “noConflict”).

jquery_kiln_search

 


How does Kiln determine which repository to search in initially?

Kiln tries to guess which repository is most likely to have the result you’re looking for based on a few factors. First, if you’re already on a repository screen or have used the repository selector widgit on the search page, then Kiln will look in that repository first first. If not, Kiln looks at your most commonly used repositories and find the first repository with a result.

Failing both of these, Kiln will show you the repository with the most results.

I keep forgetting all these search axes. Is there any other way for me to use them?

Remembering the name of each search axis can be difficult, especially if you don’t use Kiln search often. Although using the name of the axis in the query will be the fastest way to use an axis, the Search Options popup on the results page gives you a friendly interface to the same features.

kiln_search_options