Windows Vista Search: Syntax Update

I recently learned some new things about the Search APIs in Windows Vista, including some great improvements in the SQL syntax for the OLE DB Provider for Windows Search. (Thank you Chris McConnell - Architect on the Search team - for driving these changes, and for taking the time to explain them to me!).

There've been some simplifications in the syntax that happen to address a couple of things I found to be a bit odd and cumbersome:

  • System property names no longer require double quotes. Recall that the column names specified in the SELECT statement must be properties from the Windows Vista property system; and since the naming convention for properties includes dots (System . Application . Property), property names had to be delimited with double quotes. The double quotes are no longer necessary for system-defined properties (the ones that begin with System. )
  • ..SCOPE() no longer required in FROM statement. There is only a single catalog that can be searched on the desktop - and since scope is actually defined using the "Scope=" predicate in the WHERE clause - you no longer need to add that funky "..SCOPE()" stuff at the end of the FROM clause.

So, a query like this:

SELECT "System.ItemName", "System.ItemUrl" FROM SYSTEMINDEX..SCOPE()

can now be written like this:

SELECT System.ItemName, System.ItemUrl FROM SYSTEMINDEX

Much better, isn't it?

(Note that these changes reflect added flexibility, and won't break any existing queries)