Microsoft

Narrow a saved search with Vista's Query Composition feature

Vista has a feature called Query Composition, a hidden "search within results" feature. Greg Shultz shows you how to take advantage of Query Composition to find exactly what you need.

While writing about scripting Windows Sidebar gadgets for the last two editions of the Windows Vista Report, I spent a lot of time searching with the Windows Vista Search tool. I performed several wide-ranging searches using wildcard characters; for example, to find all of my VBScript scripts, I searched for *.VBS. I then saved this search so that I could quickly return to it in future research expeditions. I created and saved similar searches for the other script files.

Once I had my saved searches, I began using the grouping, filtering, and stacking features to filter through the results to narrow down the results. While this worked great, I still wanted a better filtering mechanism for my particular needs. Fortunately, there is a hidden feature in Vista called Query Composition, which is exactly the type of "search within results" feature I was hoping to find.

In this edition of the Windows Vista Report, I'll show you how to take advantage of the Query Composition feature.

Creating a saved search

The first thing that you need to do is create a saved search. To do so, launch Search from the Start menu, fill in your search criteria, and wait a few seconds while Vista conducts the search. For example, Figure A shows my Search Folder after searching for all my VBS files.

Figure A

Figure A

Begin by performing a search operation of the indexed location on your hard disk.
Once the search is complete, click the Save Search button on the toolbar to save the results as a Search Folder. When you see the Save As dialog box, type in a name (Figure B), and click the Save button.

Figure B

Figure B

Save the search results as a Search Folder.
Your new saved search will appear in the Searches folder (Figure C). Close the saved search folder.

Figure C

Figure C

You can see your saved search in the Searches folder.

Creating a Query Composition

Once you have a saved search with which you want to perform a more refined search, you're ready to create a Query Composition. To begin, launch Search from the Start menu and click the Advanced Search button to open the Advanced Search pane (Figure D).

Figure D

Figure D

Clicking the drop-down arrow opens the Advanced Search pane where you can specify more detailed search criteria.
Select the Location drop-down menu, scroll to the bottom of the list, and select Choose Search Locations. When you see the Choose Search Locations dialog box, open the Search Folders branch and select the check box next to your saved Search. As illustrated in Figure E, I've selected the All VBScript Files check box.

Figure E

Figure E

From the Choose Search Locations dialog box, select your saved searches.
When you click OK, you'll return to the Search Folder and can use the options in the Advanced pane to specify your refining search criteria. As seen in Figure F, I want to find all the VBScript files that I wrote after January 1, 2005.

Figure F

Figure F

Once you specify a saved search as the search location, you can then use the options in the Advances Search pane.

By clicking the Search button, I narrowed down my search results from 520 to 68.

Searching multiple saved searches

With the check boxes in the Choose Search Locations dialog box, you can create a Query Composition on multiple saved searches. For example, when I wanted to search through all my VBScript and JScript files, I selected both saved searches in the Choose Search Locations dialog box (Figure G).

Figure G

Figure G

I've selected multiple saved searches in the Choose Search Locations dialog box.
You can see the result of that combined search in Figure H. While my search examples were rather simple, you can begin to see the power of the Query Composition feature. This is especially true when you consider the possibilities of using more detailed combinations of various search criteria for both the saved search and the Query Composition.

Figure H

Figure H

Combining saved searches and the Query Composition feature provides you with a very powerful way to conduct searches.

What's your take on the Query Composition feature?

Now that you know how to use the Query Composition feature, how do you think you'll use take advantage of it? Drop by the Discussion area and let us know how you will use it.

Get Vista tips in your mailbox!

Delivered each Friday, TechRepublic's Windows Vista Report newsletter features tips, news, and scuttlebutt on Vista development, as well as a look at new features in the latest version of the Windows OS. Automatically sign up today!

About Greg Shultz

Greg Shultz is a freelance Technical Writer. Previously, he has worked as Documentation Specialist in the software industry, a Technical Support Specialist in educational industry, and a Technical Journalist in the computer publishing industry.

Editor's Picks

Free Newsletters, In your Inbox