Product DocsMenu

Coveo Platform 7.0 >
User Help > Basic Search > Query Syntax Reference

Coveo Query Syntax Reference

The following table presents examples of the various Coveo query syntax features that can help compose more relevant search queries. The query syntax applies to all Coveo JavaScript and .NET search interfaces.

Note: In queries, single quotes (') are not the same as double quotes ("), meaning that single quotes are interpreted as any other alphanumerical character, except in general query expressions (see Coveo Query Syntax Reference).

Important: The Coveo query syntax is enabled by default on Coveo JavaScript search pages allowing you to use special characters in queries to perform special actions. Your search page administrator can however disable the Coveo query syntax [see QueryBox Component (JavaScript Framework v1.0) or QueryBox Component (JavaScript Framework v.0.9)].

Query syntax example Returns all items
Simple Queries
term containing term
term1 term2 containing both term1 and term2
term1 OR term2 containing either term1 or term2 [more]
term1 NOT term2
term1 -term2
containing term1 but not term2 [more]
term1 NEAR:5 term2 containing both term1 and term2 contiguous within no more than five terms [more]
"term1 term2 term3" containing exactly the phrase between double-quotes [more]
'term1 term2 term3'

containing 'term1, term2, and term3'.

(missing or bad snippet)Single quotes are not the same as double quotes, meaning that single quotes are interpreted as any other alphanumerical character.

+term containing exactly term, not other words sharing the same root [more]
term*

containing term or any word starting with term and ending with any characters [more]

Note: By default, you must include at least two leading characters before the * [more]

Field Queries
@[fieldname] with any value in the specified field
from:name
to:"firstname lastname"
with from or to fields containing the specified name [more]
@title=term with the title field containing term [more]
@date=yesterday with the date field being yesterday's date [more]
@date=2015/01/01..2015/03/31 with the date field for a range of dates [more]
@size<=128 with file size field being less than 128 bytes [more]
@author==(bob,robert,rob)

@author==("bob jones","robert smith","rob johnson")

author field with either of the enumerated values [more]

Note: When an enumerated value contains more than one term, you must place the value between double quotes.

Advanced Field Queries

Note: Advanced field queries work only with facet fields (see Adding a Facet Field).

@title *= "*term1 te?m2" with the title field containing wildcard variants of the specified terms [more]
@title='term1 term2 term3'

with the title field containing 'term1, term2, or term3'.

(missing or bad snippet)Single quotes are not the same as double quotes, meaning that single quotes are interpreted as any other alphanumerical character.

@author ~= "name" with the author field containing a value with a fuzzy match for name [more]
@author %= "name" with the author field containing a value phonetically matching name [more]
@syssite /= "^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$" with the syssite field containing a string matching an IP address regular expression (regex). [more]
filetype:artist [[@artistid] [[@albumid] songtitle:love ] genre:rock ]

with the artist whose rock albums have at least one song with the word love in its title. [more]

JavaScript Search Only
term1 <@- +term2*=(term3) -@> term4

containing the terms but special characters within the no syntax block (<@- and -@>) are removed [more].

Note: No syntax blocks is typically used by administrators or developers to enclose variables to prevent special characters they contain to inadvertently affect the query.

People who viewed this topic also viewed