Merges the specified values
into the context
object.
The object to merge into the context
object. Can contain multiple key-value pairs, where each value should be a string or an array of strings. If some keys are already present in the context
object, their values are updated.
Adds or updates a single context key-value pair in the context
object.
The context key. If this key is already present in the context
object, its value is updated.
The context value. This should be a string or an array of strings.
Add fields to specifically exclude when the results return.
This can be used to accelerate the execution time of every query, as there is much less data to process if you blacklist specific fields.
Add fields to specifically include when the results return.
This can be used to accelerate the execution time of every query, as there is much less data to process if you whitelist specific fields.
Return only the expression(s) part(s) of the query, as a string, except the given expression.
This is used by Facet, to build their group by request with query override.
Return only the expression(s) part(s) of the query, as an object.
Return only the expression(s) part(s) of the query, as an object, except the given expression.
This is used by Facet, to build their group by request with query override.
Returns true if the current query contains any expression that are considered "end user input".
This usually means anything entered in the basic (see [q]{@link IQuery.options.q}) or long (see [lq]{@link IQuery.options.lq}) part of the query.
The actions history represents the past actions a user made and is used by the Coveo Machine Learning service to suggest recommendations. It is generated by the page view script (https://github.com/coveo/coveo.analytics.js).
Used to build the advanced part of the query expression.
This part is typically formed of filter expressions generated by components such as facets, external code, etc.
Specifies an array of request for the CategoryFacet component.
Specifies the childField when doing parent-child loading (See: Folding).
A request for a commerce query.
Used to build the advanced part of the query expression.
This part is similar to advancedExpression
, but its content is interpreted as a constant expression by the index and it takes advantage of special caching features.
The custom context information to send along with the query. Each value should be a string or an array of strings.
Custom context information can influence the output of Coveo Machine Learning models and can also be used in query pipeline conditions.
Used to build the disjunctive part of the query expression.
When present, this part is evaluated separately from the other expressions and the matching results are merged to those matching expressions, advancedExpression
and constantExpression
.
The final boolean expression for the query is thus (basic advanced constant) OR (disjunction).
Note:
The Coveo Cloud V2 platform does not support collaborative rating. Therefore, this property is obsolete in Coveo Cloud V2.
Whether the index should take collaborative rating in account when ranking result (See: ResultRating).
Whether to enable debug info on the query.
This will return additional information on the resulting JSON response from the Search API.
Mostly: execution report (a detailed breakdown of the parsed and executed query).
Whether to enable query corrections on this query (see DidYouMean).
Whether to interpret the AND
, NOT
, OR
, and NEAR
keywords in the basic
expression
as query operators, even if those keywords are in lowercase.
Setting this attribute to true
has no effect unless enableQuerySyntax
is also true
.
Note:
Normally, the
enableLowercaseOperators
option of theQuerybox
component determines the value of this attribute during the initialization of the search page.
Whether to automatically convert the basic expression
to a partial match
expression if it contains at least a certain number of keywords (see
partialMatchKeywords
), so that items containing at least a certain
subset of those keywords (see partialMatchThreshold
) will match the
query.
Note:
Normally, the
enablePartialMatch
option of theQuerybox
component determines the value of this attribute during the initialization of the search page.
Whether to interpret special query syntax (e.g., @objecttype=message
) in the basic
expression
(see
Coveo Query Syntax Reference).
See also enableLowercaseOperators
.
Note:
Normally, the
enableQuerySyntax
option of theQuerybox
component determines the value of this attribute during the initialization of the search page. End user preferences can also modify the value of this attribute.
Default value is false
Whether to interpret question mark characters (?
) in the basic expression
keywords (see Using Wildcards in Queries.
Setting this attribute to true
has no effect unless enableWildcards
is
also true
.
Note:
Normally, the
enableQuestionMarks
option of theQuerybox
component determines the value of this attribute during the initialization of the search page.
Whether to interpret wildcard characters (*
) in the basic expression
keywords.
Setting this attribute to true
enables the wildcards features of the index, effectively expanding keywords
containing wildcard characters (*
) to the possible matching keywords in order to broaden the query (see
Using Wildcards in Queries).
See also enableQuestionMarks
.
Note:
Normally, the
enableWildcards
option of theQuerybox
component determines the value of this attribute during the initialization of the search page.
Specifies the length (in number of characters) of the excerpts generated by the indexer based on the keywords present in the query.
The index includes the top most interesting sentences (in the order they appear in the item) that fit in the specified number of characters.
When not specified, the default value is 200.
Used to build the basic part of the query expression.
This part typically consists of user-entered content such as query keywords, etc.
The global configuration options to apply to the requests in the [facets]{@link QueryBuilder.facets} array.
Specifies an array of request for the DynamicFacet component.
Cannot be used alongside groupByRequests
Specifies a field on which Folding should be performed.
Folding is a kind of duplicate filtering where only the first result with any given value of the field is included in the result set.
It's typically used to return only one result in a conversation, for example when forum posts in a thread are indexed as separate items.
Number of results that should be folded, using the IQuery.filterField.
This is the 0-based index of the first result to return.
If not specified, this parameter defaults to 0.
Specifies an array of Group By operations that can be performed on the query results to extract facets.
Cannot be used alongside facetRequests
The contextual text.
This is the contextual text part of the query. It uses the Coveo Machine Learning service to pick key keywords from the text and add them to the basic expression. This field is mainly used to pass context such a case description, long textual query or any other form of text that might help in refining the query.
The maximum age for cached query results, in milliseconds.
If results for the exact same request (including user identities) are available in the in-memory cache, they will be used if they are not older than the specified value.
Otherwise, the query will be sent to the index.
This is the number of results to return, starting from IQuery.firstResult.
If not specified, this parameter defaults to 10.
Specifies the parentField
when doing parent-child loading (See: Folding).
The minimum number of keywords that need to be present in the basic expression
to convert it to a partial match expression.
The value of this attribute has no meaning unless enablePartialMatch
is
true
.
See also partialMatchThreshold
.
Note:
Normally, the
partialMatchKeywords
option of theQuerybox
component determines the value of this attribute during the initialization of the search page.
An absolute or relative (percentage) value indicating the minimum number of partial match expression keywords an item must contain to match the query.
The value of this attribute has no meaning unless enablePartialMatch
is
true
.
See also partialMatchKeywords
.
Note:
Normally, the
partialMatchThreshold
option of theQuerybox
component determines the value of this attribute during the initialization of the search page.
Name of the query pipeline to use.
Specifies the name of the query pipeline to use for the query. If not specified, the default value is default, which means the default query pipeline will be used.
Specifies an array of Query Function operation that will be executed on the results.
Specifies an array of Ranking Function operations that will be executed on the results.
This is the ID of the recommendation interface that generated the query.
The hub value set from the Analytics component.
Used for analytics reporting in the Coveo platform.
Specifies the sort criterion(s) to use to sort results. If not specified, this parameter defaults to relevancy.
Possible values are :
-- relevancy : This uses all the configured ranking weights as well as any specified ranking expressions to rank results.
-- dateascending / datedescending Sort using the value of the @date
field, which is typically the last modification date of an item in the index.
-- qre : Sort using only the weights applied through ranking expressions. This is much like using relevancy
except that automatic weights based on keyword proximity etc, are not computed.
-- nosort : Do not sort the results. The order in which items are returned is essentially random.
-- @field ascending / @field descending Sort using the value of a custom field.
The tab value set from the Tab component.
A request to retrieve user actions in the query response.
The QueryBuilder is used to build a IQuery that will be able to be executed using the Search API.
The class exposes several members and methods that help components and external code to build up the final query that is sent to the Search API.