Upravit

Sdílet prostřednictvím


FROM Clause

Following the SELECT statement, you use the FROM clause to specify where to search for matching documents. The following is the syntax of the FROM clause for a local query:

FROM [<ComputerName>.]SystemIndex

Currently, Windows Search supports only one catalog, SystemIndex. To query the local catalog of a remote computer, include the computer name before the catalog and a Universal Naming Convention (UNC) path on the remote computer in the SCOPE or DIRECTORY clause.

You specify a scope as a restriction in the WHERE clause, as described in the SCOPE and DIRECTORY Predicates topic.

Examples

SELECT System.ItemName,System.ItemUrl
FROM SystemIndex WHERE CONTAINS('Microsoft')

SELECT System.Author,System.ItemName,System.ItemUrl
FROM zarascomputer.SystemIndex WHERE SCOPE='file://zarascomputer/SomeFolder' AND CONTAINS('Microsoft')

SELECT System.Author,System.ItemName,System.ItemUrl
FROM server.SystemIndex WHERE SCOPE='file://server/users' AND CONTAINS('Microsoft')

In the second of the preceding examples, the query targets a remote computer called "zarascomputer". Notice that this computer name appears in both the FROM and SCOPE clauses. In the third example, the query targets a share name "users" on a server named "server" (where the UNC path would be \\server\users).

Reference

Overview of the Search SQL Syntax

SELECT Statement

WHERE Clause

SCOPE and DIRECTORY Predicates