Query the Catalog
Wednesday, January 27th, 2010If you decide to use the Indexing Service, you’ll want to learn the ways to query it.
To locate a specific document on your hard drive, you use the Indexing Service’s query language. Using this language, you can search for documents based on specific words in the document, or even phrases. You can search by author name, document size, or even the document’s ActiveX properties, such as its summary. There are five types of queries:
■ Free-text You input single words or a group of words, such as
a sentence. The Indexing Service finds documents with the same
meaning, and not necessarily the exact sentence. Think of it as
searching using a web engine, without using quotation marks around
your search words.
2
■ Phrase You input a phrase you believe to be in a document. Putting
quotes around this tells the service to locate the exact phrase.
■ Pattern-matching You input wildcards, denoted by asterisks, to
tell the service you want to search for files that contain patterns.
For instance, you can search for *.xls to locate all of the Microsoft
Excel spreadsheet files on the computer.
■ Relational You input the words you want to search for, and then
add Boolean operators such as And, Or, Not, Near, and =. The results
are sorted in relation to how you input the operators.
■ Vector space You input specific words or phrases you want to find
in a document, and then decide how much “weight” you want each
of the words or phrases to be assigned. There is no easy way to input
this information, and queries look something like this:
book, {weight value=.3} cover, {weight value=.3} Hard Core,
{weight value=.4}
Once you’ve decided on what type of query you want, you need to input it. You can search using the query language from the Search option or from inside the Computer Management console. Since you’re likely already in the console, you can practice from there. You need to know some rules before you get started, many of which are also applied when searching with a web browser and looking for something on the Internet:
■ The search data you input is not case sensitive.
■ Some words are automatically omitted from searches, and they are
all common words: all, as, be, but, did, he, them, to, too, very, and
your.
■ If you must use a character in a query, such as &, #, or @ (and there
are others), enclose those in parentheses so the service does not think
they are operators or wildcards.
■ The best form in which to input dates and times is yyyy/mm/dd and
hh:mm:ss.
■ You can use tags to construct queries, which are indicated by braces,
{ }. Tags are used in long form queries; when tags are not used, it is
referred to as the short form.
■ The @ sign is used to introduce a phrase query. Examples are
@filename=*.xls (all file names created with Microsoft Excel or
with that file extension), @DocTitle“Hard Core XP” (any file with
the title Hard Core XP).
■ & means and, | means or, and ! means not. These symbols are used
in Boolean queries such as hard & core (contains both words), book |
cover (contains either word), and book ! picture (contains book but
not picture).
The Indexing Service Query Language is quite complex, and what I’ve introduced here is only the beginning. To see more details regarding this language, consult the Windows XP Help and Support pages.