Tucked in the upper right hand corner of every Windows 7 file folder that you open is a search box. You type something in it, and Windows whirls away for a moment and fetches a list of documents in the folder below, and its subfolders. What does it do? What the heck did it do! Sometimes, the Windows 7 search can be confusing, especially when coming from Windows XP, where you had to spell things out in a brutal conversation with a poorly rendered cartoon character.
The Windows 7 search bar packs in a lot of the power of command line tools in both Windows own powershell, other operating systems such as Linux's bash, and even some of the power of document management systems used in the legal community. It offers searching by filenames or parts of filenames, file contents, document meta deta, and even has intellisense - that popup menu that gives you a list of choices for a given field. Finally, search terms can be combined with logical operators, AND, OR, and NOT.
The basic search for Windows, is to just type in one or more keywords. Windows 7 performs a search that says "bring me back any file that contains the phrase I type in, or has that phrase in the filename. The Windows 7 filesystem, NTFS, is actually a sort of a database, with fields, and those fields called "metadata", can be searched as well. In this image, Windows 7 has located not only images that have my son's name in the title, but also, images that were tagged with his name when I uploaded them from my camera. Search results are highlighted in yellow on the filename. If the filename is not highlighted, then Windows 7 found it in some other way. In this example, the tags that I applied when I uploaded the images have also been searched, and I can confirm that by clicking on a file to preview it. Note that the search results will not be highlighted in the tags. Maybe in Windows 8?
Enter datetaken: into the search box to find photos on the date they were actually taken. Windows 7 will bring up a calendar control that lets you navigate your images by the date they were taken. Windows 7 files are organized as if in a database, with fields, and Windows 7 can search them. For example, when you import photos from your camera, Windows 7 copies over the date taken for that image and stores it. Be warned that Windows 7 can be picky about choosing when to use intellisense.
Enter kind: into the search box to search for files by kind. Windows 7 gives you intellisense on the search, and you can just select them from a menu. Windows 7 looks at all the types of files in your folders and organizes them by their kind. So, you don't have to remember all the different file formats, such as .doc or .xls or .xlw, all mean an Office document, or that .jpg and .png all mean image.
Enter FileName: into the search box to search for files by extension. Windows 7 gives you intellisense for that.
You can combine multiple search terms. Each term separated by space serves to narrow down the results, working as an AND operator. In this example, I search for all files that have both garrett and pirate in the name. FileName:=~garrett FileName:=~pirate. That gives me back only those files that have both garrett and pirate in the filename. Now, if I wanted to search for files that were named garrett or files that had pirate in the name, I could use FileName:=~garrett OR FileName:=~pirate
The basic Windows 7 search contains is always live and may be combined with field searches. This is handy, for me, as I sometimes want to use an existing computer source code file as an example.
I can search for file extensions of cpp that contain CreateWindow, for example, to get an example of how to create a window. Writers, who often gather up a lot of content for reference, can do something similar.
Punctuation marks and special characters in search phrases don't work well at all in Windows 7. For example, let's say you are searching for an IP address in a bunch of text files, and you remember part of it, 192.168. Key that into the search box, and Windows 7 won't find anything! Searching on just 192 or just 168 works as expected, and, searching on 192 168 serves to narrow things down quite a bit. However searching on MyObject.MethodCall works entirely correctly. Theories abound as to what Windows 7 does, but to date, no one seems to have found an escape character or a make this a literal string set of delimiters to convince Windows to do this search correctly. My guess is that short strings after the . trick Windows into thinking that the search string is part of a filename, and so, Windows invokes the filename search first. Perhaps Windows 7 sees 192.168 as search for all files containing 192 with extension .168. I'll have to try it.
| To | Enter | Results |
|---|---|---|
| Look for pictures | kind:=picture | All files with of a picture type. |
| Look for filenames containing text | FileName:~=text | All files whose name contains text. |
| Look for filenames containing text | FileName:~=text | All files whose name contains text. |
| Look for filenames with extension ext | extension:~=ext | All files with extension ext. |
| Look for filenames containing name, with extension ext | FileName:name extension:~=ext | All files with extension ext whose name contains name |
| Look for filenames whose contents contain name, with extension ext | extension:~=ext name | All files with extension ext whose contents contains name |
| Look for filenames over 125mb | size:gigantic | Really big files |