Clears the content of the input.
Return the debug info about this component.
Disable the component. Normally this means that the component will not execute handlers for the framework events (query events, for example). Components are enabled by default on creation.
Enable the component. Normally this means that the component will execute handlers for the framework events (query events, for example). Components are enabled by default on creation.
Return the bindings, or environment, for the current component.
Gets the HTMLInputElement
of the Omnibox.
Gets the current content of the input.
The current content of the input.
Sets the content of the input
The string to set in the input.
Adds the current content of the input to the query and triggers a query if the current content of the input has changed since last submit.
Also logs a searchboxSubmit
event in the usage analytics.
Get the bound component to the given HTMLElement. Throws an assert if the HTMLElement has no component bound, unless using the noThrow argument.
If there is multiple component bound to the current HTMLElement, you must specify the component class.
HTMLElement for which to get the bound component.
Optional component class. If the HTMLElement has multiple components bound, you must specify which one you are targeting.
Boolean option to tell the method to not throw on error.
Allows the component to bind events and execute them only when it is enabled.
Contains the state of options for different components. Mainly used by ResultLink.
Contains the state of different components (enabled vs disabled). Allows to get/set values. Triggers component state event when modified. Each component can listen to those events.
A disabled component will not participate in the query, or listen to ComponentEvents.
Allows component to log in the dev console.
Contains the singleton that allows to trigger queries.
Contains the state of the query. Allows to get/set values. Trigger query state event when modified. Each component can listen to those events.
A reference to the root HTMLElement (the SearchInterface).
A reference to the root of every component, the SearchInterface.
The static ID that each component needs in order to be identified.
For example, SearchButton -> static ID: SearchButton -> className: CoveoSearchButton
A reference to the Analytics.client.
Whether to clear all active query filters when the end user submits a new query from the search box.
Note: This does not include the filter expression enforced by the currently selected tab, if any.
data-clear-filters-on-new-query='true' data-clear-filters-on-new-query='false'
The field
addon makes the Omnibox
highlight and complete field syntax. Setting this option to true
automatically sets
the enableQuerySyntax option to true
as a side effect.
Example:
Suppose you want to search for PDF files. You start typing
@f
in the search box. TheOmnibox
provides you with several matching fields. You select the@filetype
field. Then, you start typing=p
in the input. This time, theOmnibox
provides you with several matching values for the@filetype
field. You select theenableQuerySyntax
option is set totrue
, the Coveo Search API interprets the basic expression as query syntax and returns the items whose@filetype
field matches the
Default value is false
.
data-enable-field-addon='true' data-enable-field-addon='false'
If Querybox.options.enableQuerySyntax is true
, specifies whether to enable the query extension
addon.
The query extension
addon allows the Omnibox to complete the syntax for query extensions.
Default value is false
.
data-enable-query-extension-addon='true' data-enable-query-extension-addon='false'
Whether to display Coveo Machine Learning (Coveo ML) query suggestions in the Omnibox
.
A Coveo ML query suggestions (QS) model must be properly configured in your Coveo Cloud organization, otherwise this option has no effect (see Create a QS Model).
Note:
When you set this option and the
enableSearchAsYouType
option totrue
, the query suggestion feature returns the auto-completion of the currently typed keyword as its first query suggestion.
data-enable-query-suggest-addon='true' data-enable-query-suggest-addon='false'
Specifies whether the Coveo Platform should try to interpret special query syntax such as field references in the query that the user enters in the Querybox (see Coveo Query Syntax Reference).
Setting this option to true
also causes the query syntax in the Querybox to highlight.
Default value is false
.
data-enable-query-syntax='true' data-enable-query-syntax='false'
Whether to automatically trigger a new query whenever the end user types additional text in the search box input.
See also the searchAsYouTypeDelay
option.
Note:
If you set this option and the
enableQuerySuggestAddon
option totrue
, the query suggestion feature returns the auto-completion of the currently typed keyword as its first suggestion.
Default value is false
.
data-enable-search-as-you-type='true' data-enable-search-as-you-type='false'
Specifies whether query completion suggestions appearing in the Omnibox
should push the result list and facets
down, rather than rendering themselves over them (and partially hiding them).
Set this option as well as Omnibox.options.enableSearchAsYouType and
Omnibox.options.enableQuerySuggestAddon to true
for a cool effect!
Default value is false
.
data-inline='true' data-inline='false'
Specifies the number of suggestions that should appear in standard ML-powered query suggestions.
This option only affects the number of suggestions that appear with the Omnibox.options.enableQuerySuggestAddon option.
This options does not affect the AnalyticsSuggestions or the FieldSuggestions component, which expose their own dedicated options for this parameter.
Default value is 5
.
Minimum value is 1
.
data-number-of-suggestions='10'
Specifies a timeout (in milliseconds) before rejecting suggestions in the Omnibox.
Default value is 2000
. Minimum value is 0
.
data-omnibox-timeout='10'
Specifies a placeholder for the input.
data-placeholder='foo'
The minimum number of characters required in the in the text input before displaying available query suggestions when focus is on the component.
Note: Only effective when enableQuerySuggestAddon is true.
depend: 'enableQuerySuggestAddon'
Default (and minimum): 0, meaning that trending query suggestions are displayed when focus is on the component, even if its text input is empty.
data-query-suggest-character-threshold='10'
If Omnibox.options.enableSearchAsYouType is true
, specifies the delay (in milliseconds) before
triggering a new query when the end user types in the Omnibox
.
Default value is 2000
. Minimum value is 0
.
data-search-as-you-type-delay='10'
Creates a new Omnibox component. Also enables necessary addons and binds events on various query events.
The HTMLElement on which to instantiate the component.
The options for the Omnibox component.
The bindings that the component requires to function normally. If not set, these will be automatically resolved (with a slower execution time).
The
Omnibox
component extends theQuerybox
, and thus provides the same basic options and behaviors. Furthermore, theOmnibox
adds a type-ahead capability to the search input.You can configure the type-ahead feature by enabling or disabling certain addons, which the Coveo JavaScript Search Framework provides out-of-the-box (see the
enableFieldAddon
,enableQueryExtension
, andenableQuerySuggestAddon
options).Custom components and external code can also extend or customize the type-ahead feature and the query completion suggestions it provides by attaching their own handlers to the
populateOmniboxSuggestions
event.See also the
Searchbox
component, which can automatically instantiate anOmnibox
along with an optional SearchButton.