I know I’m searching for something, Something so undefined, That it can only be seen, By the eyes of the blind, In the middle of the night.
The Basic Windows Desktop Search – Skip to the second part for more advanced stuff if you already know this!
I am one of those people who save copies of everything. I don’t think I have ever deleted an email from my Windows Live Hotmail accounts or from Outlook. I regularly save web pages as a single file web archives. I make lot of Adobe PDF files. And I have tons of media. My TiVo stores some of its recordings on this PC and Media Center too. I use Outlook as well and all the MS Office apps. So there are lots and lots of files on my system.
So, if your like me, you’ll have files dispersed all over the place on your computer. And there are lots of them. Did I say that already? I have a multi terabyte system. And it is full. Every drive has about 2 gigs free. So, how do you find stuff when you might not even be sure what it is your looking for, and it’s the middle of the night?
Well, Windows Search 4 AKA Windows Desktop Search comes to the rescue. This is a free addition to virtually every version of Windows since Windows 2003 and XP. But this article will focus just on Vista. If you have another MS OS then go to Windows Search 4 to get it gratis. If your Windows Updates are current you probably already have it.
However, it’s built into Vista and newer operating systems from Microsoft. So, let’s take a closer look at Vista’s search capabilities. Most people using Vista already know about the search features built into it. Two common places it is used are in the search box on the start menu and the search box in Windows File Explorer. Some people might assume typing a simple word is all you can do to search, but they would be missing out on some good stuff.
The focus of this discussion will be in File Explorer. So, open up File Explorer and start here:
To start you’ll need to type something into the search area. As you type the results will update reflecting the “as you type” query.
The second area of interest I would like to point out are the “Save Search” and “Search Tools” These allow you to fine tune your searches and save them for future use.
So, if you haven’t done so already, start by typing your search terms in the search box where it says “Type something here to search” to start. I typed that sentence into mine to show you where to type in yours. Yours will just say “Search”. This starts the search as you type, and shows the found files in the area below. In the sample you see it has “No items match your search.” And this is because there were no search hits in this folder based on the sentence I entered. Usually, the search will take place in the folder you currently have open, but you can change that. We’ll do that now.
First type some search term into the search box to start a search. This can be a part of a file name, if you can remember it, something in the file, if you have the search file contents active – we’ll look at that in a bit, a tag, an author’s name for a document, etc. But once you type something the options shown in the lower red box (in the above image) will appear so you can “Save Search” or open “Search Tools.” We’ll open “Search Tools” now by clicking on it :
“All” is selected by default meaning that every type of file that search can find will be included. I have found that this can be annoying because it includes email, and I usually have a gazillion emails that will match just about any search I perform. So, by selecting one of the other options, “Document”, “Picture”, “Music”, or “Other” I can exclude emails. This really helps narrow down a search. Using these options is fairly straight forward so I won’t dwell on this feature. Let’s continue onto the next tool. Click on the circular button with the dropdown icon in it at the other side of this bar:
And this opens a new pane shown here:
The parameters for your search are set here to fine tune it. This is much like previous versions of search. You just fill in the parameters and click the Search button. The search defaults to the current folder. The Location dropdown can change this. The first couple of items in the dropdown are of interest so let’s look at those:
Another interesting choice here is the “Choose search locations” which, once selected, will open a location chooser box. This is nifty as it allows you to select multiple locations to search simultaneously. This can be useful in a saved search.
The search system maintains indexes that track all these attributes of your files. But not all files are indexed. System files are not by default. So by changing the location to “Everywhere” or “Indexed Locations” you can perform global searches so the results will not be limited to the folder you currently have open. Some things are not indexed such as certain file type, system files, hidden files and the like.
Wherever you set your search location you can also check the “Include non-indexed, hidden, and system files (might be slow)” check box. This is sort of how the older Microsoft operating system searches worked. It then searches most everything in this location by directly scanning files instead of relying on the really fast index.
Now, a really nice feature is the ability to save this search once you define it. When you click the “Save Search” button a standard save file dialog box opens. There is a default location already selected. This is where some predefined searches “out of the box” live, and you can add more here or you can save them elsewhere. I like to save some of them right in my “Documents” folder. These become a sort of virtual folder, and by opening the search it automatically performs the search showing all the results. For example I have one saved in my “Documents” folder that just shows Adobe Acrobat PDF files. Unfortunately, search only returns the first 5000, and I have more PDF files than this. So a warning appears telling me to narrow my search. This arbitrary number can probably be tweaked in the registry, but that is beyond the scope of this discussion.
OK. No problem. With the search opened I can now type into the search selection box at the upper right corner and further narrow the search. This is on the currently open search just as if I were in a folder. The result will be a set of PDF files simply because the base search only returns PDF files. That’s pretty kewl if you ask me.
So, that’s how simple, basic searches work in a nutshell. Let’s look at those other two options in the “Search Tools” button. Selecting the first, “Search Options” opens this window:
The three areas allow you to choose how you want you want your searches performed. This is how mine is setup. These options are self explanatory so I won’t go into details except to say that I added “Use natural language search” and “Include compressed files (ZIP, CAB…)” and left the rest alone. I’ll go into natural language searching in an upcoming post. If you select the compressed files setting then search will find you files even if they are buried inside an archive such as a ZIP file. This could be handy for some, but many won’t need it.
The second option is to “Modify Index Locations…” shown here:
Again, the settings here should usually be left as defaulted unless you have a reason to change them. But it’s here that you can set the file types that are indexed, the folders that are in the index, and other things. Modify allows you to include and exclude locations and Advanced allows you to select the files types, index locations, whether indexing is done on properties only or the contents of the file as well – on a file type by file type basis. So some file types like Word documents can be searched not only by file name, author and dates, but by words in the document as well. Other types do not index the contents. You can make changes for this behavior here. You can also relocate the index itself (not recommended) and on the rare occasion that your index stops working correctly or becomes corrupted somehow you can come here to rebuild it. Only change these if you know what you are doing and have a certain need.
The Second Part! Even more fun stuff you can do with Search
So far we have looked at easy ways to find files, but did you know the search feature is far more powerful that what you’ve seen? For example, some people are aware that you can use wildcards in searches. Normally search will only find things based on words that begin with what you type in the search box. So, if you were to type in “plane” it would find files with words (such as in the file name, the author’s name, or a tag) beginning with “plane” but might miss some that contain “plane” in the word such as “airplane” as it doesn’t start with “plane.” It starts with “air.” This is by design and is the basic nature of indexes in general. But you could instead use a wildcard.
A wildcard is a character that represents a pattern of other characters, and in this case we’ll be using an asterisk wildcard. The asterisk wildcard represents any string of characters, including no characters at all. So, I could type into the search box
Now the results will include airplanes as well as all other planes and interplanetary, etc. So, I mentioned that I had a search in my “Documents” that found PDF files. So, how do you do that? Well, start by typing
in the search box. The asterisk represents any name at all before the period. This finds all files of type PDF in the current location. Then you can save this search and use it whenever you like.
Asterisk is sometimes called a “star” by some people. And a “star” by itself represents any string of characters at all. So just a star in the search box would return every file in the current location if you have less than the search limit of 5000 files, but a star followed by a period followed by a file extension results in every file in that location of that type. Common ones are “*.txt” for all text files or “*.doc” for certain Word documents. You don’t need the quotes just what is inside them.
Now, with Office 2007 there are new file types such as docx and docm for the new Word file formats. The *.doc won’t find those because they have an extra letter after the “doc” part. But if you change it just a little to “*.doc*” then you’ll get all these files as well as it will find any files with a type that begins with “doc” followed by anything – including nothing at all. So even plain old doc files with be found too.
So, how far can you take this? Good question. You could certainly do a search, say for all text files that have “plane” in the filename. That would look like the first entry below or any file that has any attribute, such as a tag, that contains the “plane” pattern in it or the third one which restricts the results to files of any type so long as they have “plane” in the name. The fourth entry is another way to do this.
So multiple wildcards can be useful too. But as it turns out there is a whole language for searching that Microsoft has defined called Advanced Query Syntax. I will blog more about it in an upcoming post in more detail, but for a little taste we’ll just have a little look.
First, you can use boolean operator such as “AND” and “OR” and “NOT”. These need to be capitalized. If you put search terms inside quotes it looks for the exact string including spaces. You can use “>”, “<”, for greater that or less that or before or after, for example, and “..” for a range. You can group things using parenthesis. For dates you can use terms like today, tomorrow, yesterday, this week, this month, this year, last week, etc. So you can enter queries into the search box like
*plane NOT plane*
which results in 35 files on my computer. In order to be a “hit” on this search you must have a attribute that contains “plane” in it but it must not begin with “plane”. Most have the word “interplanetary” or something like that in the file or in the title.
To further narrow this search to only files with names that have “plane” in them but “plane” isn’t at the beginning of a word we can use this:
name:(*plane NOT plane*)
Which results in 13 hits on my computer.
Different applications set properties or attributes on files. Photo software such as Windows Live Photo Gallery, for example, lets you set tags. These can be searched by query. You can search photos that were taken with a certain camera during a certain time period with a certain size picture – if you know how. But so can emails based on if they have an attachment with certain attributes. Contacts are searchable by many attributes such as the spouses name or a job title. Email has a lot of attributes that can also be searched on. It goes way beyond what you might think. More to come later – stay tuned!
One I like to use a lot is “folder” which is an attribute of a file. If I type “folder” in the search box I get 2446 hits of any type of file in my “Documents” that is either a folder, like a folder, or contains the word “folder” and such. If I change that to “type:folder” in the search box that limits it to just proper folders. This eliminates cab files and anything selected because it contains the word “folder.” However, stored searches still show up as they are a form of virtual folder as well as compressed folders.
So, if I knew I had a folder with something like “lib” in the name I could enter “lib” in the search box. This results in 968 files on my system. This is probably as far away from the actual folder that you can get, and this is what most people would do. Then they would read through the 968 results looking for the needle in the haystack.
Most of the results are not folders. If I change the search by entering “lib type:folder” then I get 299 files (actually folders) listed. Most of these do not have “lib” in the name, but “lib” is somehow used for picking them based on the contents of the folders. So, to further refine this we could type:
which results in just three folders out of the 20201 files and 2433 folders that are in my “Documents.” Now, that’s finding something!
Not bad! Especially considering that this type of search query isn’t always possible using the search GUI interface. This particular one is, sort of, but there are many complex ones that are not possible using just the GUI. Did I mention that the GUI interface just helps you by building the syntax for these searches? As such, it cannot address every possible search. In fact, it only does the simplest. So knowing how to set up your own search queries and saving them can be a fun and useful hobby!
Amway, this is just a taste to whet your appetite for the advanced functionality available within search. In an upcoming blog I will go into further detail about this and what you can do with it and the nature of the saved search. That is, if enough people are interested.
So, until next time!
Oh, and thanks for the title, Billy Joel, from lyrics of River of Dreams!