Tuesday, March 31, 2009

[Inside TeamCompanion 2.1] Using Outlook 2007 Instant Search for offline work item search

Instant Search is the way to perform precise and fast search within Outlook 2007 mails, tasks, contacts, etc. You can also use it to perform full text search within work items even if you are offline. Searching arbitrary text is easy. Just select query folder and type word or phrase you want to search. Searching for the text within specific work item fields is somewhat more involved, but is also very easy, as we will demonstrate shortly. Purpose of this text is to demonstrate both approaches.

To be able to search while offline, we first need to fetch the work item information from the server in online mode. In TeamCompanion, scheduled execution of work item queries is usualy used for that. Let's suppose we want to search within work items that were returned by some query called „Test Query“. On the right side the first few work items are visible:

If we want to search for text „process guidance“, we would simply type that text in the Instant Search text box. Note that phrase must be enclosed in quotes because we want to search fields that contain both the „process“ word and „guidance“ word. These are the results:

The result is as expected; search result consists of work items that contain the phrase „process guidance“.

Let's suppose that we want to restrict our search to some specific work item fields and not all of them. To accomplish that, search queries must be used. Generally, search queries have the following form: keyword:search criteria value. When searching within a single field, keyword is the name of the field and search criteria value is the phrase that field must contain for the item to appear in the search result. In the case of TeamCompanion, basic search query has the following form: [Tfs:work item field name]:search criteria value. Work item field name is the name of the column in query view and search criteria value is the phrase to search. Note that work item field must be added as column in order to be used for search (to add columns, right-click query folder and click „Customize View“). Square brackets are required because TeamCompanion prefixes work item field names with „Tfs:“. Since colon is used by the Instant Search as the separator between keyword and search criteria value, we must tell Instant Search that colon in Tfs:work item field name is not separator. To do this we enclose Tfs: work item field name with the square brackets.

Now, let's look at few examples. Assume we want to search for the phrase: „Set up“ in the Title field. Our search query must have the following form: [Tfs:Title]:“Set up“. This is the result:

Search results now consist of work items that have the phrase „Set up“ in their Title field.

Instant Search allows usage of the standard logical operators: AND, NOT, OR, <, >, =, etc. Next example will show how to use logical operators to create a bit more complicated search queries. Suppose we want to search work items that have word „task“ in their description but ID for that work items must be less than 200. Search query for the first condition is [Tfs:Description]:task, and search query for the second condition is [Tfs:ID]:<200. Since we want work items that satisfy both of these condition, we're going to use AND operator to combine previous search queries into the single search query: [Tfs:Description]:task AND [Tfs:ID]:<200. Search results are:


That's it! As you can see, searching work items is easy.
For more information about search queries, you may find these links helpful:
Learn to narrow your search criteria for better searches in Outlook and Office Online on using Instant Search
[This blog entry was written by Dini Selimovic who implemented large parts of TeamCompanion.]

0 Comments:

Post a Comment

<< Home