Query (Search)

The Query element is a required child element of the Store element in Search command requests that specifies the keywords to use for matching the entries in the store that is being searched.

All elements referenced in this section are defined in the Search namespace.

Command request/response

Parent elements

Child elements

Data type

Number allowed

Search command request (section

Store (section

And (section

EqualTo (section

container ([MS-ASDTYPE] section 2.2)

1...1 (required)

The value of the Query element is used as a prefix-string matching pattern, and returns entries that match the beginning of the string. For example, searching for "John" would match "John Frum", but would not match "Barry Johnson" or "James Littlejohn".

All nonempty text properties in the GAL that are indexed by using ANR are compared with the Query element value. Search comparisons are performed by using case-insensitive matching.

For a Windows SharePoint Services document library search, this protocol supports queries of the following form: LinkId == value, where value specifies the URL of the item or folder and LinkId indicates that the value is to be compared to the link ID property.

For mailbox search, the query syntax is as follows:

  • Folders can be specified in the following ways:

    • Specified ID

    • Specified folder and subfolders

    • All email folders, including Draft, Inbox and subfolders, Outbox, and Sent Items

  • The basic keyword query can be composed of the following:

    • The basic operator: And (section

    • A dateTime filter specified by using the GreaterThan (section and LessThan elements (section

    • FreeText elements (section that contain keywords

The basic keyword query is executed against all indexed properties.

Protocol Versions

The following table specifies the protocol versions that support this element. The client indicates the protocol version being used by setting either the MS-ASProtocolVersion header, as specified in [MS-ASHTTP] section, or the Protocol version field, as specified in [MS-ASHTTP] section, in the request.

Protocol version

Element support