Overview of the Windows SharePoint Services Search Query
This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A Search in Windows SharePoint Services query is similar to a standard SQL query, as shown in the syntax.
SELECT <columns>
FROM <content source>
WHERE <conditions>
RANK BY <conditions>
ORDER BY <columns>
Remarks
The Search query syntax supports many options, enabling more complicated queries.
The following table describes each clause in the SELECT statement, and the features it supports.
Clause |
Description |
---|---|
SELECT |
Specifies the columns returned by the query. |
FROM |
Specifies the location to search. |
WHERE |
Specifies what constitutes a matching document. This clause has many options, enabling rich control over the search conditions. For example, you can match against words, phrases, inflectional word forms, strings, numeric and bitwise values, and multivalued arrays. You can also combine matching conditions with Boolean operators. |
ORDER BY |
Specifies the sort order for the results returned by the query. You can specify more than one field on which the results are sorted, and you can use ascending or descending ordering. |
Query Example
The following example searches for documents where the title contains "SharePoint".
SELECT rank, title, path, author from Scope() WHERE CONTAINS(title,'SharePoint')
See Also
Reference
SELECT Statement in Windows SharePoint Services Search SQL Syntax
FROM Clause in Windows SharePoint Services Search SQL Syntax
WHERE Clause in Windows SharePoint Services Search SQL Syntax