Understanding Advanced Search Query Language

This advanced topic describes in detail the search grammar used for ZCSSearch feature.

Search Language Structure

Simple searches can be done by just entering a word into the search field. Bare words (words without a search operator) are interpreted to search in the 'content:' operator -- this matches any text in the message.

More advanced searches can be done by specifying a search operator. A search operator is a special keyword followed by a colon, followed by some other parameter specific to that operator. For example:

- in:inbox the operator is "in" and the parameter is " inbox" - this returns messages which are in the folder named " inbox"

- from:someone the operator is "from" and the parameter is "someone" - this returns messages which have the word "someone" in their email address

You can prefix any keyword with the word "not" to specify items that do not have that criterion, for example not in:inbox. Search is not case sensitive, meaning that "in:inbox" is the same as "in:Inbox". The minus sign (-) is a synonym for NOT So: not in:inbox is the same as -in:inbox

In most cases, it is not necessary to include punctuation-type characters in your search string, as these are ignored by the search code. There are certain times where this is not true (for example, searching for a time '9:30' in a message) and in those cases you should enclose the search parameter in quotation marks. For example: subject:"9:30" will return messages which have the string 9:30 in the subject.

Allowable characters in the search parameter:

- The following characters cannot be anywhere in a search parameter unless it is enclosed by quotes: ~ ' ! # $ % ^ & * ( ) _ ? / { }[ ] ; :

- The following characters are allowed in a search parameter as long as they are not the first character: - + < >

Note: Special characters, such as trademark symbols that are part of a word, are removed when the word is indexed for search. They are ignored in a search. For example, a search for Zimbra™ finds all references to Zimbra, including those without the trademark symbol.

Multiple Search Terms

If multiple search terms are entered (separated by spaces), they are " ANDed" together by default. in:inbox tim means "return me messages which are in the inbox AND which have the word tim in them". For searches using multiple criteria, you can either find items that match one of the specified criteria or all of them. You can perform both types of searches from the advanced search page.

For all search panes other than the Basic search, the rules are:

Searching for messages that match any of the specified criteria is called an 'OR' search, because if the message contains either X or Y, then it is considered a match.

- Searching for messages that contain both X and Y is called an 'AND' search, because the message must meet all the specified criteria in order to be considered a match.

- Only "OR" appears in a query. If you selected as an option to show the search query in the Search bar as you make selections in the Advanced search, the Search text box updates to show the resulting query. With the 'AND' type of search, the word 'AND' does not appear.

Tip: Using parenthesis with AND and OR. Words within parentheses are considered as a unit. For example from: (john thomas) is equivalent to from:john AND from: thomas. If you use OR in the parenthesis, from:(john or smith), the search is for results from:john OR from: smith.

Using * as a Wildcard in Search

The asterisk (*) can be used as a wildcard at the end of a word in a search to find content that contains words that have similar spellings.

Use the asterisk * as a wildcard. For example, the search string do* returns items such as do, dog, door, etc.

Note: A double-byte asterisk sign in a search query is not considered a wildcard character and is ignored when the search runs.

-------------------------------------------------------------------------------------------------------
Copyright @ 2005-2017 Synacor, Inc. All rights reserved. "Zimbra" is a registered trademark of Synacor, Inc.