Tripoli Query Language
Using the query page, you can do a full-text search for a word or phrase on a Web site. Searches produce a list of files that contain the word or phrase anywhere in
their text.
The rules for formulating queries are as follows:
- Multiple consecutive words are treated as a phrase; they must appear in the same order within a matching document.
- Queries are case-insensitive, so you can type your query in uppercase or lowercase.
- You can search for any word except for those in the exception list (for English, this includes a, an, and, as, and other common words), which are ignored
during a search.
- Words in the exception list are treated as placeholders in phrase and proximity queries.
- Punctuation marks such as the period (.), colon (:), semicolon (;), and comma (,) are ignored during a search.
- To use specially treated characters such as &, |, ^, #, @, $, (, ), in a query, enclose your query in quotation marks (").
- You can use Boolean operators (and, or, not) and the proximity operator (near) to specify additional search information.
- The wildcard character (*) can be used to match words with a given prefix. The query esc* matches the terms ESC, escape, and so on.
- Free-text queries can be specified without regard to query syntax.
- Vector space queries can be specified.
- Activex (OLE) and file attribute property value queries can be issued.
Boolean and proximity operators can be used to create a more precise query.
To search for | Example | Results |
Both terms in the same page | access and basic
-or-
access & basic | Pages with both the words "access" and "basic" |
Either term in a page | cgi or isapi
-or-
cgi | isapi | Pages with the words "cgi" or "isapi" |
The first term without the second term | access and not basic
-or-
access & ! basic | Pages with the word "access" but not "basic" |
Pages not matching a property value | not @size = 100
-or-
! @size = 100 | Pages that are not 100 bytes |
Both terms in the same page, close together | excel near project
-or-
excel ~ project | Pages with the word "excel" near the word "project" |
Hints:
- You can use parentheses to nest expressions within a query. The expressions in parentheses are evaluated before the rest of the query.
- Use double quotes (") to indicate that a Boolean or Near operator keyword should be ignored in your query. For example, "Abbot and Costello" will match
pages with the phrase, not pages that match the Boolean expression.
- The Near operator returns a match if the words are within 50 words of each other.
- The Not operator can be used only after an And operator in content queries; it can be used only to exclude pages that match a previous content restriction.
For property value queries, the Not operator can be used apart from the And operator.
Wildcard operators are useful for finding pages with words similar to a given word.
The query engine finds pages that best match the words and phrases in a free-text query. This is done by automatically finding pages that match the meaning, not the
exact wording, of the query. Boolean, proximity, and wildcard operators are ignored within a free-text query. Free-text queries are prefixed with $contents.
The query engine supports vector space queries. Vector queries return pages that match a list of words and phrases. The rank of each page indicates how well the
page matched the query.
To search for | Example | Results |
Pages that contain specific words | light, bulb | Files that best match the words |
Pages that contain weighted prefixes,
words, and phrases | invent*, light[50], bulb[10],
"light bulb"[400] | Files that contain words prefixed by invent, the words light, bulb,
and the phrase light bulb (the terms are weighted) |
- Components in vector queries are separated by commas.
- Components in vector queries can be weighted using the [weight] syntax.
- Pages returned by vector queries do not necessarily match every term in the query.
- Vector queries work best when the results are sorted by rank.
Property value queries can be used to find files that have property values that match a given criteria. The properties over which you can query include basic file
information like file name and file size, and ActiveX (OLE) properties including the document summary that is stored in files created by ActiveX-aware applications.
There are two types of property queries, relational queries and regular expression queries.
- Relational property queries consist of an "at" character (@), a property name, a relational operator, and a property value. For example, to find all of the files
larger than one million bytes, issue the query @size > 1000000.
- Regular expression property queries consist of a number sign (#), a property name, and a regular expression for the property value. For example, to find to
find all of the video (.avi) files, issue the query #filename *.avi. Regular expressions will never match the special properties contents (#contents) and
all (#all). There may also be additional format-specific properties that cannot be matched (for example, #HtmlHRef for HTML pages).
Property names are preceded by either the "at" (@) or number sign (#) character. Use @ for relational queries, and # for regular expression queries.
If no property name is specified, @contents is assumed.
Properties available for all files include:
ActiveX (OLE) property values can also be used in queries. Web sites with files created by most ActiveX-aware applications can be queried for these properties:
A more complete list of properties can be found here.
Relational operators are used in relational property queries.
To search for | Example | Results |
Property values in relation to a fixed value | @size < 100
@size <= 100
@size = 100
@size != 100
@size >= 100
@size > 100 | Files whose size matches the query |
Property values with all of a set of bits on | @attrib ^a 0x820 | Compressed files with the archive bit on |
Property values with some of a set of bits on | @attrib ^s 0x20 | Files with the archive bit on |
To search for | Example | Results |
A specific value | @DocAuthor = Bill Gates | Files authored by "Bill Gates" |
Values beginning with a prefix | #DocAuthor George* | Files whose author property begins with "George" |
Files with any of a set of extensions | #filename
*.|(exe|,dll|,sys|) | Files with .exe, .dll, or .sys extensions |
Files modified after a date | @write > 96/2/14 10:00:00 | Files modified after February 14, 1996 at 10:00 GMT |
Files modified after a relative date | @write > -1d2h | Files modified in the last 26 hours |
Vectors matching a vector | @vectorprop = { 10, 15, 20 } | ActiveX documents with a vectorprop value of { 10, 15, 20 } |
Vectors where each value matches a
criteria | @vectorprop >^a 15 | ActiveX documents with a vectorprop value in which all values in the vector
are greater than 15 |
Vectors where at least one value matches a
criteria | @vectorprop =^s 15 | ActiveX documents with a vectorprop value in which at least one value is 15 |
- Be sure to use the pound (#) character before the property name when using a regular expression in a property value, and an at (@) character otherwise.
The equal (=) relational operator is assumed for regular expression queries.
- File name (#filename) is the only property that supports regular expressions with wildcards to the left of text. Wildcards in regular-expressions for all other
properties must come after a prefix.
- Date and time values are of the form yyyy/mm/dd hh:mm:ss. The first two characters of the year and the entire time can be omitted. Dates and times are in
Greenwich Mean Time (GMT).
- Dates and times relative to the current time can be expressed with a minus (-) character followed by zero or more integer and time unit pairs. Time units are
expressed as: (y) for years, (m) for months, (w) for weeks, (d) for days, (h) for hours, (n) for minutes, and (s) for seconds.
- Currency values are of the form x.y, where x is the whole value amount and y is the fractional amount. There is no assumption about units.
- Boolean values are (t) or (true) for true and (f) or (false) for false.
- Vectors (VT_VECTOR) are expressed as an opening brace ({), a comma-separated list of values, then a closing brace (}).
- Single-value expressions that are compared against vectors are expressed as a relational operator, then a (^a) for All Of or a (^s) for Some Of.
- Numeric values can be in decimal or hexadecimal (preceeded by 0x).
- The contents property does not support relational operators. If a relational operator is specified, no results will be found. For example, @contents
Microsoft will find documents containing Microsoft, but @contents=Microsoft will find none.
Regular expressions in property queries are defined as follows:
- Any character except *, ., ?, and | defaults to matching just itself.
- Regular expressions can be enclosed in matching quotes ("), and must be enclosed in quotes if they contain a space ( ) or closing parenthesis ()).
- The characters *, ., and ? behave as they behave in Windows; they match any number of characters, match (.) or end of sentence, and match any one
character, respectively.
- The character | is an escape character. After |, the following characters have special meaning:
- ( opens a group. Must be followed by a matching ).
- ) closes a group. Must be preceded by a matching (.
- [ opens a character class. Must be followed by a matching (un-escaped) ].
- { opens a counted match. Must be followed by a matching }.
- } closes a counted match. Must be preceded by a matching {.
- , separates OR clauses.
- * matches zero or more occurrences of preceding expression.
- ? matches zero or one occurrences of preceding expression.
- + matches one or more occurrences of preceding expression.
- Anything else, including |, matches itself.
- Between [ and ] the following characters have special meaning:
- ^ matches everything but following classes. Must be the first character.
- ] matches ]. May only be preceded by ^, otherwise it closes the class.
- - range operator. Preceded and followed by normal characters.
- Anything else matches itself (or begins or ends a range at itself).
- Between { and } the following syntax applies:
- |{m|} matches exactly m occurrences of the preceding expression. (0 < m < 256).
- |{m,|} matches at least m occurrences of the preceding expression. (1 < m < 256).
- |{m,n|} matches between m and n occurrences of the preceding expression, inclusive. (0 < m < 256, 0 < n < 256).
- To match *, ., and ?, enclose them in brackets (for example, |[*]sample will match "*sample").
Example | Results |
@size > 1000000 | Pages larger than one million bytes |
@write > 95/12/23 | Pages modified after the date |
Apple tree | Pages with the phrase apple tree |
"apple tree" | Same as above |
@contents apple tree | Same as above |
Microsoft and @size > 1000000 | Pages with the word Microsoft that are larger than one million bytes |
"microsoft and @size > 1000000" | Pages with the phrase specified (not the same as above) |
#filename *.avi | Video files (the # prefix is used because the query contains a regular expression) |
@attrib ^s 32 | Pages with the archive attribute bit on |
@docauthor = William Gates | Pages with the given author |
$contents why is the sky blue? | Pages that match the query |
@size < 100 & #filename *.gif | Graphics Interchange Format (GIF) files less than 100 bytes in size |
These properties are always available for queries. Additional properties may also be available depending on the configuration of the Web server.
Property Name | Description |
Access | Last time file was accessed |
All | Everything |
AllocSize | Size of disk allocation for file |
Attrib | File attributes |
ClassId | Class ID of object |
Change | Last time file was changed (includes changes to attributes) |
Characterization | Characterization / abstract of document. Computed by Tripoli |
Contents | Main contents of file |
Create | Time file was created |
DocAppName | Name of application owning file |
DocAuthor | Author of document |
DocCharCount | Number of characters in document |
DocComments | Comments about document |
DocCreatedTm | Time document was created |
DocEditTime | Total time spent editing document |
DocKeywords | Document keywords |
DocLastAuthor | Most recent user who edited document |
DocLastPrinted | Time document was last printed |
DocLastSavedTm | Time document was last saved |
DocPageCount | Number of pages in document |
DocRevNumber | Current version number of document |
DocSecurity | |
DocSubject | Subject of document |
DocTemplate | Name of template for document |
DocThumbNail | |
DocTitle | Title of document |
DocWordCount | Number of words in document |
FileIndex | Unique ID of file |
FileName | Name of file |
HitCount | Number of hits (words matching query) in file |
HtmlHRef | Text of HTML HREF |
Path | Full physical path to file, including file name |
Rank | Rank of row (ranges from 0 to 1000); larger numbers indicate better matches |
SecurityChange | Last time security was changed on file |
ShortFileName | Short (8.3) file name |
Size | Size of file, in bytes |
USN | Update Sequence Number (NTFS drives only) |
VPath | Full virtual path to file, including file name (if more than one possible path, then the best match for the specific query is chosen) |
Write | Last time file was written |
© 1996 by Microsoft Corporation. All rights reserved.