Windows 7 / Getting Started

Running Custom Searches

When you open a folder window, you know that you can click inside the Search box, type some text, and you get a list of files and folders that match your text. This worked well in Windows Vista, but it really rocks in Windows 7 because the latest version of the Desktop Search engine is even faster. However, simple text searches aren't going to radically boost anyone's productivity or help you find a file needle in a hard disk haystack. To take searching to the next level, you need to know about two obscure but powerful search features: Advanced Query Syntax and natural language queries.

Using Advanced Query Syntax to Search Properties

When you run a standard text search from any Search box, Windows looks for matches not only in the filename and the file contents, but also in the file metadata: the properties associated with each file. That's cool and all, but what if you want to match only a particular property. For example, if you're searching your music collection for albums that include the word Rock in the title, a basic search on rock will also return music where the artist's name includes rock and the album genre is Rock. This is not good.

To fix this kind of thing, you can create powerful and targeted searches by using a special syntax-called Advanced Query Syntax (AQS)-in your search queries.

For file properties, you use the following syntax:

property:value

Here, property is the name of the file property you want to search on, and value is the criteria you want to use. The property can be any of the metadata categories used by Windows. For example, the categories in a music folder include Name, Track, Title, Artists, Album, and Rating. Right-click any column header in Details view to see more properties such as Genre and Length, and you can click More to see the complete list.
Here are a few things to bear in mind:

  • If the property name is a single word, use that word in your query. For example, the following code matches music where the Artists property is Coldplay:
    artists:coldplay
  • If the property name uses two or more words, remove the spaces between the words and use the resulting text in your query. For example, the following code matches pictures where the Date Taken property is August 23, 2009:
    datetaken:8/23/2009
  • If the value uses two or more words and you want to match the exact phrase, surround the phrase with quotation marks. For example, the following code matches music where the Genre property is Alternative & Punk:
    genre:"alternative & punk"
  • If the value uses two or more words and you want to match both words in any order, surround them with parentheses. For example, the following code matches music where the Album property contains the words Head and Goats in any order:
    album:(head goats)
  • If you want to match files where a particular property has no value, use empty braces, [], as the value. For example, the following code matches files where the Tags property is empty:
    tags:[]

You can also refine your searches with the following operators and wildcards:

>
Matches files where the specified property is greater than the specified value. For example, the following code matches pictures where the Date Taken property is later than January 1, 2009:
datetaken:>1/1/2009

>=
Matches files where the specified property is greater than or equal to the specified value. For example, the following code matches files where the Size property is greater than or equal to 10000 bytes:
size:>=10000

<>
Matches files where the specified property is less than the specified value. For example, the following code matches music where the Bit Rate property is less than 128 (bits per second):
bitrate:<128

<=
Matches files where the specified property is less than or equal to the specified value. For example, the following code matches files where the Size property is less than or equal to 1024 bytes:
size:<=1024

..
Matches files where the specified property is between (and including) two values. For example, the following code matches files where the Date Modified property is between and including August 1, 2008 and August 31, 2008:
datemodified:8/1/2008..8/31/2008

*
Substitutes for multiple characters. For example, the following code matches music where the Album property includes the word Hits:
album:*hits

?
Substitutes for a single character. For example, the following code matches music where the Artists property begins with Blu and includes any character in the fourth position:
artists:blu?

For even more sophisticated searches, you can combine multiple criteria using Boolean operators:

AND (or +)
Use this operator to match files that meet all of your criteria. For example, the following code matches pictures where the Date Taken property is later than January 1, 2009 and the Size property is greater than 1000000 bytes:
datetaken:>1/1/2009 AND size:>1000000

OR
Choose this option to match files that meet at least one of your criteria. For example, the following code matches music where the Genre property is either Rock or Blues:
genre:rock OR genre:blues

NOT (or -)
Choose. For example, the following code matches pictures where the Type property is not JPEG:
type:NOT jpeg

NOTE The Boolean operators AND, OR, and NOT must appear with all-uppercase letters in your query.

[Previous] [Contents] [Next]