Creating persistent search folders in Vista

I’ve been noodling around with search folders in Vista. The one that shows up by default in the shell’s Favorite Links panel, entitled Recently Changed, is of particular interest. Just like the Recent Changes page in a wiki, it’s a nice way to monitor activity in a dynamic system that’s always accreting new stuff.

Good news: The Recently Changed folder is governed by an XML file, in the Searches subdirectory of the home directory, called Recently Changed.search-ms:

<?xml version="1.0"?>
<persistedQuery version="1.0">

<viewInfo viewMode="details" iconSize="16">
  <sortList>
    <sort viewField="System.DateModified" direction="descending"/>
  </sortList>
</viewInfo>

<query>
  <conditions>
    <condition type="leafCondition" valuetype="System.StructuredQueryType.DateTime" 
    property="System.DateModified" operator="imp" 
    value="R00UUUUUUUUZZXD-30NU" propertyType="wstr" />
  </conditions>

<kindList>
  <kind name="document"/>
  <kind name="picture"/>
  <kind name="music"/>
  <kind name="movie"/>
  <kind name="video"/>
  <kind name="note"/>
  <kind name="journal"/>
  <kind name="email"/>
</kindList>

<subQueries>
  <subQuery knownSearch="{4f800859-0bd6-4e63-bbdc-38d3b616ca48}"/>
</subQueries>

</query>
</persistedQuery>

Bad news: I can’t figure out to write my own queries. value="R00UUUUUUUUZZXD-30NU"? What’s up with that? I guess this relates in some way to the advanced query syntax for Windows desktop search. But I can’t find any examples that look like this:

<conditions>
  <condition type="leafCondition" valuetype="System.StructuredQueryType.DateTime" 
  property="System.DateModified" operator="gt" value="date:yesterday" />
</conditions>

There must be documentation for this somewhere, but at the moment there are very few hits in any of the search engines for the query: vista persistedquery. That’s a shame. I know that advanced search doesn’t appeal to the masses, but sure does appeal to me.

5 Comments

  1. We’re considering making available a tool for constructing strings for representing relative date/time, such as the “R00UUUUUUUUZZXD-30NU” from above. If not, I hope to describe them in a future blog post.

  2. So typical of Microsoft: why make it easy when you can make it complicated and then offer a tool. And what’s with all those GUIDs, anyways?
    There is something similar to vista’s search folders (or mac’s smart folders) but for Windows XP/2000 and it’s called zenFolders (zenfolders.googlepages.com). It uses Google Desktop Search and search strings are saved in a human readable xml files.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s