Advanced search techniques

Advanced Search Terms -- Operators to Help You to Create More Defined Searches

Windows Vista and Windows Desktop Search 3.01 recognize many advanced query operators that can make your desktop searches super-pinpointed.  This document provides an exhaustive list of those operators.  On Windows Vista you can use these operators to define a search, and then save it as a Search Folder.  Once you start using these terms in searches and Search Folders, you'll wonder how you ever got along without them!

Quick Start Operators

Type this ...

To find this ...

windows

Items containing WinDOwS, windows, WINDOWS or any other combination of uppercase and lowercase letters

microsoft windows

Items containing both words microsoft and windows

microsoft NOT windows
Note: The word NOT must be in all uppercase letters

Items containing microsoft, but not windows.

microsoft not windows
Note: The word not must be in all lowercase letters

Items containing all three words—microsoft, not, windows—but not necessarily in that order

microsoft OR windows
Note: The word OR must be in all uppercase letters

Items containing microsoft, windows, or both.

microsoft or windows
Note: The word or must be in all lowercase letters.

Items containing all three words—microsoft, or, windows—but not necessarily in that order

"microsoft windows"

Items containing the exact phrase microsoft windows.

microsoft has attachment:true

Items that have attachments containing the word microsoft

microsoft isattachment:true

Items that are attachments containing the word microsoft

microsoft date:yesterday

Items containing the word microsoft whose date is yesterday

Windows Desktop Search also recognizes the following date values:

·          Relative dates: For example, today, tomorrow, yesterday

·          Multi-word relative dates: For example, this week, next month, last week, past month, coming year

·          Days: Sunday, Monday ... Saturday

·          Months: January, February ... December

 

author: patrick

Items created by someone whose name contains the word patrick.

author:"patrick hines"

Items created by patrick hines.

subject:"microsoft windows"

Items whose subject contains the phrase microsoft windows.

subject:microsoft windows

Items with the word microsoft in the subject line and windows anywhere else in the document.

 

Advanced Operators

Desktop Search syntax

Keyword/ Symbol

Example

Function

NOT

microsoft NOT windows

Finds items containing microsoft, but not windows

-

microsoft - windows

Finds items containing microsoft, but not windows

AND

microsoft AND windows

Finds items containing microsoft and windows

+

microsoft + windows

Finds items containing microsoft and windows

Quotation marks

"microsoft windows"

Finds items containing the exact phrase microsoft windows

Parentheses

(microsoft windows)

Finds items containing the terms microsoft and windows in any order

> 

date: >11/05/04
size: >5

Finds items with a date after 11/05/04
Finds items with a size greater than 5

< 

date: <11/05/04
size: <5

Finds items with a date before 11/05/04
Finds items with a size less than 5

Note: Boolean operators must be in all UPPERCASE letters.

Boolean operators

Property

Example

Function

has:attachment

report has:attachment

Finds items containing the word report that have attachments. Same as hasattachment:true

is:attachment

report is:attachment

Finds items that have attachments containing the word report. Same as isattachment:true

before:date

before:10/9/2004

Finds items whose PrimaryDate field contains a date before 10/9/2004.

after:date

after:10/9/2004

Finds items whose PrimaryDate field contains a date after 10/9/2004.

author:name

author:patrick

Finds items with patrick in the author property.

author:"name"

author:"patrick hines"

Finds items with the words patrick hines, in that order, in the author property.

author:(name)

author:(patrick hines)

Finds items with patrick and hines in the Author property.

author:(name OR name)

author:(patrick OR bob)

Finds items with patrick or bob in the Author property.

author:name name

author:patrick bob

Finds items with patrick in the Author property and bob anywhere in the document.

from:name

from:patrick

Finds items with patrick in either fromName OR fromAddress, since "from" is a property name for both fromName and fromAddress.

Numbers and ranges

To specify a date range, type the property followed by two dates.  Closed date ranges are indicated by typing "...".  For example, type from:david sent:11/05/04...11/05/05.  Windows Desktop Search recognizes all Windows date formats and also recognizes the following values:

·         Relative dates: For example, today, tomorrow, yesterday

·         Multi-word relative dates: For example, this week, next month, last week, past month, coming year

·         Days: Sunday, Monday ... Saturday

·         Months: January, February ... December

Dates and date ranges

Syntax

Results

size:>50 <70

Searches for files with a value in the Size property between 50 and 70, excluding those sizes

size:>=50 <=70

Searches for files with a value in the Size property between 50 and 70, including those sizes

date:>2/7/05<2/10/05

Searches for a date in the Date property between the values 2/7/05 and 2/10/05, excluding the end dates

date:>=2/7/05<=2/10/05

Searches for a date in the Date property between the values 2/7/05 and 2/10/05, including the end dates

Common file properties

The syntax listed in the preceding table can be used with any of the following file properties.  For example, to find email from "jake" that was sent in 2005, your query would look like this: kind:email author:patrick after:12/31/2004. 

To restrict by file type

Use

Example

Communications

communications

kind:communications

Contacts

contacts

person

kind:contacts

kind:person

E-mail

email

kind:email

Instant Messenger conversations

im

kind:im

Meetings

meetings

kind:meetings

Tasks

tasks

kind:tasks

Notes

notes

kind:notes

Documents

docs

kind:docs

Music

music

song

kind:music

kind:song

Pictures

pics

pictures

kind:pics

kind:pictures

Videos

videos

kind:videos

Folders

folders

kind:folders

Folder name

foldername

foldername:mydocs

Programs

programs

kind:programs

Recorded TV

tv

kind:tv

Link

link

kind:link

Journal entry

journal

kind:journal

 

To restrict by file store

If you use several email accounts and you want to limit a query to either Microsoft Office Outlook or Outlook Express, you can use the store: indicator.

Store

Use

Example

Files

file

store:file

Offline files

csc

store:csc

Outlook

mapi

store:mapi

Outlook Express

oe

store:oe

 

Properties for file type: All

These are file format-specific properties you can use

Property

Use

Example

Title

title, subject, about

title:manager

Status

status

status:active

Date

date

date:lastweek

Date modified

datemodified, modified

modified:lastweek

Importance

importance, priority

importance:high

Size

size

size:>50

Deleted

deleted,isdeleted

isdeleted:true

Is attachment

isattachment

isattachment:false

To

to, toname

to:johnsmith

Cc

cc, ccname

cc:david

Company

company

company:adventure-works

Category

category

category:business

Keywords

keywords

keywords:sports

Album

album

album:greatest

File name

filename, file

filename:2006hits

Genre

genre

genre:jazz

Author

author, by

author:david

Folder

folder, under, path

folder:sample

Ext

ext, fileext

ext:.rtf

File name

filename, file

filename:sample

Tags

tag, keyword

tag:personal

Type

type

type:image

 

Properties for file type: Contact

These are great Outlook contact-specific operators

Property

Use

Example

Job title

jobtitle

jobtitle:manager

IM address

imaddress

imaddress:luis@adventure-works.com

Assistant's phone

assistantsphone

assistantsphone:sample

Assistant name

assistantname

assistantname:roberto

Profession

profession

profession:accountant

Nickname

nickname

nickname:louis

Spouse

spouse

spouse:susana

Business city

businesscity

businesscity:redmond

Business postal code

businesspostalcode

businesspostalcode:98052

Business home page

businesshomepage

businesshomepage:www.adventure-works.com

Callback phone number

callbacknumber

callbacknumber:sample

Car phone

carphone

carphone:sample

Children

children

children:anna

First name

firstname

firstname:maria

Last name

lastname

lastname:gonzalez

Home fax

homefax

homefax:sample

Manager's name

manager

manager:carlos

Pager

pager

pager:sample

Business phone

businessphone

businessphone:sample

Home phone

homephone

homephone:sample

Mobile phone

mobilephone

mobilephone:sample

Office

officelocation

officelocation:red/101

Anniversary

anniversary

anniversary:yesterday

Birthday

birthday

birthday:tomorrow

 

Properties for file type:  Communications (email, appointments)

These operators can help you quickly find that right set of email or that contact you need.

Property

Use

Example

From

from, organizer

from:simon

Received

received, sent

sent:yesterday

Subject

subject, title

subject:budget

Has attachment

hasattachment, hasattachments

hasattachment:true

Attachments

attachments, attachment

attachment:presentation.ppt

Bcc

bcc, bccname

bcc:michael

Bcc address

bccaddress, bcc

bccaddress:sample

Cc address

ccaddress, cc

ccaddress:sample

Follow-up flag

flagstatus

flagstatus:unflagged

flagstatus:followup

flagstatus:completed

To address

toaddress, to

toaddress:sample

Due date

duedate, due

due:10/15/2006

Read

read, isread

isread:false

Is completed

iscompleted

iscompleted:true

Incomplete

incomplete

incomplete:true

Has flag

hasflag, isflagged

hasflag:false

Duration

duration

duration:>120

 

Properties for file type:  Calendar

Need to find an appointment?  These appointment-specific operators can let you quickly search your entire calendar.

Property

Use

Example

Recurring

isrecurring

recurring

isrecurring:true

recurring:true

Organizer

organizer, by, from

organizer:jonas

Location

location

location:calgary

 

Properties for file type:  Documents

Here are some handy doc-specific operators.  "Last saved by" is super-useful when a document is being co-authored by a group of people.

Property

Use

Example

Comments

comments

comments:excellent

Last saved by

lastsavedby

lastsavedby:Josh

Document manager

documentmanager

documentmanager:sample

Revision number

revisionnumber

revisionnumber:4a

Date last printed

datelastprinted

datelastprinted:yesterday

Slide count

slides

slides:>20

 

Properties for file type:  Music

Music fans, these terms will let you find that track or group of tracks you need in an instant.

Property

Use

Example

Bit rate

bitrate

bitrate:>150kbps

Artist

artist, by

artist:sample

Year

year

year:sample

Duration

duration

duration:sample

Album

album

album:"greatest hits"

Genre

genre

genre:rock

Lyrics

lyrics

lyrics:"happy birthday to you"

Track

track

track:12

Year

year

year:>1980<1990

 

Properties for file type:  Picture

If you're a shutterbug and just want to share some photos with friends and family, these terms can help to manage your library of photos.

Property

Use

Example

Camera make

cameramake

cameramake:sample

Camera model

cameramodel

cameramodel:sample

Dimensions

dimensions

dimensions:sample

Orientation

orientation

orientation:sample

Date taken

taken

datetaken

taken:last year

datetaken:6/12/2006

Width

width

width:sample

Height

height

height:sample

Flash mode

flashmode

flashmode:no flash

 

Properties for file type:  Recorded TV

Find that TV show or movie and grab some popcorn.

Property

Use

Example

Broadcast date

broadcastdate

broadcastdate:2005

Channel number

channel

channel:7

Closed captioning

closedcaptioning

closedcaptioning:true

Date released

datereleased

datereleased:2005

Episode name

episodename

episodename:sample

 

Properties for file type: Video

Property

Use

Example

Name

name, subject

name:sample

Ext

ext

filext

ext:sample

filext:sample

 


Comments

  1. Posted on: August 28, 2007 at 9:30AM  

    Nick,

    I son't want to come across as hostile or angry, but I do agree with the point that others have made about the new search capabilities.  As designed, I simply don't find them trust worthy.  You seem to have sacrificed speed for dependability and usability.  I know that you guys are focused on the new and sexy thing, and you're trying to compete with others, but this new search is not a step in the right direction because you have ignored your bread and butter clients who want a no nonsense search.

    I could select the type of search that gave me the control.  I didn't have to allow you to guess whether a file was a document or music or whatever.  I could type in *.* and get EVERY file on my system if I wanted to.  I had control.  I do not like the new interfaces that seize control for the sake of making it more usable for those who are not very savvy.

    I don't want to have to familiarize myself with a bunch of nuances (your word) that you have added to the search.  Actually I wouldn't mind if I thought it would work, but so far my experience with your search is that it is wildly unreliable.  I never know what might appear when I type something in the search box.  For example.  I just searched for something and the only thing that appeared were emails!  Who knows what I did to trigger the system to decide that my context or whatever was email.  I  wasn't even running an email program.

    Essentially you are forcing us to give up on your search capabilities.  This translates into your customers testifying to others that for all practicle purposes Vista lacks any functional search capability.  You should be more concerned about this problem than your responses indicate.  You've got a BIG problem for those of us who actually need to search for files.

    My experience is that most people who use PCs have never even tried to search for stuff on their PC so they won't care, but you've given the rest of us one more reason to start exploring alternative operating systems, and isn't that EXACTLY what Microsoft is trying to avoid with its attempt to revamp the search capability in the first place?

    Maybe I'm wrong about the capabilities.  Maybe you can give me a command that will not try to second guess what I am looking for and just search for whatever the heck I tell it to search for.  If so, can you tell me where that command is?

  2. Posted on: August 28, 2007 at 9:34AM  

    corrections to previous post  (I'm so frustrated I can't even think straight!;):

    I don't want to come across as hostile or angry, but I do agree with the point that others have made about the new search capabilities.  As designed, I simply don't find them trust worthy.  You seem to have sacrificed dependability for speed and usability.

  3. Posted on: August 31, 2007 at 7:59AM  

    Okay here's an example of my problem.  I tried the same search on both of my machines (one XP one Vista).  I searched for a document that is on the hard drive of my XP machine and on a plugged in flash drive of my Vista machine.

    On XP I typed *.doc in one field and "reasonably intelligent" in the contents field.  It took it about 3 minutes to find the file.

    On Vista I typed *.doc reasonably intelligent in the start search field: immediately it said "no items match your search."  This statement is inaccurate.  If it cannot find a match through it quick process then it should continue searching rather than tell me that there are no matches.  Saying, "no items match your search" indicate that it is finished searching, and it is telling me definitively that such a document does not exist.

    The odd thing is that if I remove the contents qualifier, and simply search for "*.doc" then the document that contains "reasonably intelligent" appears in the list!

    From the start menu I click "search everywhere."  I take this as a clue that perhaps Vista did not actually search everywhere the first time-which I find to be a bizaar possibility.  I cannot understand why from the start screen you would decide to tease your users:  "Oh yes I know you want me to search for this file, but I think I will just look in a few places rather than everywhere because I'm just obnoxious that way!"  Dude, when I use the "search" function it because I don't know where something is, right?  If I don't know where it is, then I want you to search everywhere for it.

    At any rate, the search pane appears.  It's not obvious what one should do differently with this, so I decided to select advanced search.  I then point to my flash drive, to give it a little help.  (In my case I DO know where this file is and I am just testing Vista!)  Even then it comes up with nothing.  I click on "Include non-indexed, hidden, and system files(might be slow)."  It ain't slow; it immediately tells me the same thing: "no items match your search."

    At this point I want to swear off your new search capabilities, and frankly I begin to wonder what else did Microsoft bungle in its new Vista design.

    The point of this post is not to vent but to give you details of my experience so that perhaps you can either tell me what I did wrong or tell me that there is indeed a problem that Microsoft will address or tell me that this is the way the designers want the search to work and I should expect the same sort of logic applied to other features in Vista.

  4. Jim
    Posted on: August 31, 2007 at 8:28PM  

    Hi Nick, thanks for your description of the search query language -- it works well for me. (As mentioned by someone earlier, it'd be handy if there were a link from the advanced search pane to a description of the search query language).

    Here's my question:  I've created a multi-phrase search and saved it (so the file name is foo.search-ms); by multi-phrase, I mean it has query terms connected by AND's and/or OR's.  It works.  Now I want to change this saved search's query slightly.  How do I do that?  I can't even figure out how to display the saved search query in Windows Explorer (I can do it using SendTo->Notepad, but that just gives me an XML file).

    In summary:  How do I view and edit the query of saved searches?

    I'm using Home Premium and Classic view.

    Also, a lesser concern:  It'd be nice if Explorer treated a saved search more like a folder, eg., right-clicking on it would bring up appropriate folder operations, such as Properties giving the number of files and sum of sizes of the files.  In general, it'd be nice if saved searches were more like folders, ie., if they were virtual folders.  Then view templates, etc would work on search results too.  Also, then I would be able to give Microsoft's Photos screensaver, when it asks for a folder root, a saved search as its input (a perfect application of a saved search!).

  5. Posted on: September 07, 2007 at 3:19AM  

    I know this might not be the place to ask this question but maybe some of might be able to help me?

    My search is working fine as long as I don't click on "Show only E-Mail". Then zero results will be displayed although all the e-mails are displaying when don't filter the "all" results.

    Why could this be?

  6. Posted on: September 16, 2007 at 2:24PM  

    Here is a clue regarding why it seems that “Vista Search” is not working as expected.

    I’m using the Norwegian version of Vista Ultimate.

    I created 24 folders and files with Lars77 as part of the name. Two files and one folder were marked as hidden.

    By using the command line “cmd /b /s *Lars77*” 21 files was found and using “cmd /b /s /ah *Lars77*” the remaining 3 files was found.

    In the Search Explorer (Start|Search) I used the following: Location “Everywhere”, selected “All” for type of files, selected "Include non-indexed, hidden, and system files", and entered “*Lars77*” in the Instant Search box.  8 files was found, among them 1 hidden folder and 2 hidden files.

    Then, in the Search Explorer window: “Organize” -> “Folder and search options” -> “Folder Options” window -> “View” -> “Advanced settings”, I deselected the “Hide protected operating system files (Recommended)” option. After clicking the “OK” button, the window closed, and the search started over again – to find 24 files...  

    Nick, is this by design? As long as hiding protected operating system files is recommended, I don’t find it intuitive to have this option deselected.

    In the “Folder Options” window -> “View” -> “Advanced settings”, you can select either “Do not show hidden files and folders” or “Show hidden files and folders”.  Both options will list hidden files. Is this by design as well?

    This test was run from the standard user that created the folders and files, from another standard user (which found all files except those placed under the file structure for the user that created the folders and files), and from an admin user (found 24 files).

    An annoying “feature” experienced by deselecting the “Hide protected operating system files (Recommended)” option, is that in the user folder (“Lars”) I have a sub-folder named “Dokumenter” (“Documents”) and a non-working link named “Mine dokumenter” (“My documents”).

  7. Posted on: September 20, 2007 at 2:32PM  

    Hey Lars:  sorry this took some time to get to you, I had to track down the right internal expert to get this information.

    The option in "Folder Options" window -> “View” -> "Advanced settings" is a persistent global setting.  When set to “show” hidden files, hidden files will be visible (grayed-out) when browsing folders as well as in search results.  

    The "include non-indexed, hidden, and system files)" checkbox in the Advanced search pane is a transient setting that persists only for the life of that search and refers only to search results.  If your global setting is already set to "show", then this checkbox will have no effect on hidden files (but will still affect whether or not we search system folders and non-indexed locations).

    Similarly, if the global setting is toggled back to "hide", this checkbox will only have an effect on the current search window, and hidden files will not be visible when browsing other folder locations.

    Hope this helps clarify for you.

  8. Posted on: September 21, 2007 at 12:41PM  

    Thanks.  This clarified some.

    This explains the hidden files issue. It could be discussed if you should be allowed to override the global setting for “Show hidden files” in the search window.

    The "Include non-indexed, hidden, and system files" choice is a little bit confusing. It should be broken into three choices. I might want to include non-indexed, but not hidden and system files.  If you in the Folder Options have selected the “Do not show hidden files and folders”, the “Include hidden files” could be disabled as an option.  This is what I as a user would expect.

    Is the files included in “system files” in the "Include non-indexed, hidden, and system files" option the same files as are included in the “Hide protected operating system files (Recommended)” option in the Folder Options Window?  If yes, the “Include system files” option in the advanced search should be enabled only if “Hide protected operating system files” is deselected.

    What you didn’t answer was the “Hide protected operating system files (Recommended)” issue.  Here is a simple test to demonstrate that something seems wrong is Search:

    Log on as a standard user.

    In the Search Explorer window: “Organize” -> “Folder and search options” -> “Folder Options” window -> “View” -> “Advanced settings”, select the “Hide protected operating system files (Recommended)” option.

    In your Documents folder, create a new folder (e.g. “Lars77”, and create a document in the new folder (e.g. Lars77.bmp”).

    Run a search. In the Search Explorer window (Start|Search) use the following: Location “Everywhere”, select “All” for type of files, select "Include non-indexed, hidden, and system files", and enter a filename mask (e.g. “*Lars77*”) in the Instant Search box. The folder and the file you created will not be found.  Please explain why!

    In the Search Explorer window: “Organize” -> “Folder and search options” -> “Folder Options” window -> “View” -> “Advanced settings”, deselect the “Hide protected operating system files (Recommended)” option.

    Run a new search, using the same settings as in the first search. The files are found!

    The files you created seems to be treated as system files…  Please explain why!

    Please explain why I have to deselect the “Hide protected operating system files (Recommended)” option to find my non-system folders and files under my user folder.

  9. Posted on: September 27, 2007 at 3:07PM  

    Hi Nick,

    I still find that my most frequent search is to want to see all of the email threads I have with any paricular email account or email domain - becasue I want to know what has been said by them and by me in the past, so I can sound intelligent and organised when I speak to them,.  This means that I have to type 'to:<string> OR from:<string>' commands into the search box, for eaxample

       to:lyalla OR from:lyalla

    It doesn't seem to radical a requeat that I would be able type a single command to get all of the emails from a particular addresss (or part-address) something like

        thread:lyalla

    or

        mails:lyalla

    or some such

    The main reason that this is much more productive is that apart from more typing, it is sometimes hard to type a part-address in twice and get the same characters in the right order!

  10. Posted on: September 27, 2007 at 3:14PM  

    Hey wgrahamt:  this sounds like a great case for Search Folders, which are essentially longstanding virtual locations containing all items relating to a certain set of search criteria.  As items are added to the system, the Indexer places a shortcut to the new relevant items in the appropriate Search Folder for easy retrieval at any time.  Take a look at this article for details:  http://windowsvistablog.com/blogs/windowsvista/archive/2007/05/10/searching-part-ii-using-search-folders.aspx.

Trackbacks

  1. Posted by: Windows Vista Team Blog on May 09, 2007 at 8:25PM

    A couple of weeks ago we showed you some of the more popular keyboard shortcuts in Windows Vista. Now

  2. Posted by: Teamzille.de on May 10, 2007 at 3:02PM

    Mit Windows Vista hat Microsoft auch eine mchtige Suchfunktion in das Betriebssystem integriert. Diese Suchfunktion bietet aber noch wesentlich mehr Funktionen, als man auf den ersten Blick vielleicht denken knnte. So lsst sich zum Beispiel durch ein

  3. Posted by: US ISV Developer Evangelism Team on June 27, 2007 at 10:29AM

    In my travels amongst ISVs, I find very technical folks who find search in Vista a little, well…, rudimentary

  4. Posted by: Connected to Vista Bookmarks on August 07, 2007 at 9:42PM

    64-Bit Support Correct Disk Cleanup shortcut for Windows Vista 64-bit (Kristan M. Kenney, Canucky.net)

  5. Posted by: Scott Forsyth's WebLog on April 04, 2008 at 10:39AM

    Searching for file content on your computer or server is a common task and one where you would expect

  6. Posted by: Worth noting today | Trader Eyal on January 03, 2009 at 10:01AM

    Pingback from  Worth noting today | Trader Eyal

  7. Posted by: search not finding partial phrases | keyongtech on January 18, 2009 at 10:24AM

    Pingback from  search not finding partial phrases | keyongtech

  8. Posted by: Vista search anomalies | keyongtech on February 17, 2009 at 8:03AM

    Pingback from  Vista search anomalies | keyongtech