Scan the element and all its children for known components. Initialize every known component found.
Scan the result element and all its children for known components. Initialize every known result component found.
See also : Initialization.automaticallyCreateComponentsInside.
The root element to scan for known components
The result which needs to be passed to each result component constructor.
A set of options to inject for the components found inside the resultElement. These options will be merged with any options passed during the "init" call of the search interface.
Return the list of all components that are currently eagerly loaded.
Return the list of all known components (the list of ID for each component), whether they are actually loaded or not.
Return the component class definition, using it's ID (e.g. : 'CoveoFacet').
This means the component needs to be eagerly loaded.
Returns all the fields that the framework currently knows should be added to the query, for a given component.
This is used when the is set to true
(which is true
by default).
The framework tries to only include the needed fields from the index, for performance reasons.
Create a new recommendation search interface. This is the function executed when calling Coveo.initRecommendation
.
Create a new standard search interface. This is the function executed when calling Coveo.init
.
Create a new standalone search interface (standalone search box). This is the function executed when calling Coveo.initSearchbox
.
Initialize the framework. Note that this function should not normally be called directly, but instead using a globally registered function (e.g.: Coveo.init), or Initialization.initSearchInterface or Initialization.initStandaloneSearchInterface
(e.g. : Coveo.init
or Coveo.initSearchbox
).
The element on which to initialize the interface.
The options for all components (eg: {Searchbox : {enableSearchAsYouType : true}}).
The function to execute to create the SearchInterface component. Different init call will create different SearchInterface.
Check if a component is already registered, using it's ID (e.g. : 'Facet').
Check if the method is already registed.
'Monkey patch' (replace the function with a new one) a given method on a component instance.
Register a new Component to be recognized by the framework.
This essentially mean that when we call Coveo.init
, the Initialization class will scan the DOM for known component (which have registed themselves with this call) and create a new component on each element.
This is meant to register the component to be loaded "eagerly" (Immediately available when the UI scripts are included)
Set the fields that the component needs to add to the query.
This is used when the is set to true
(which is true
by default).
The framework tries to only include the needed fields from the index, for performance reasons.
The id for the result template component (see Result Templates).
Register a new set of options for a given element.
When the element is eventually initialized as a component, those options will be used / merged to create the final option set to use for this component.
Note that this function should not normally be called directly, but instead using the global Coveo.options
function
Register a new globally available method in the Coveo namespace (e.g.: Coveo.init
).
The method name to register.
The function to execute when the method is called.
The main purpose of this class is to initialize the framework (a.k.a the code executed when calling
Coveo.init
).It's also in charge or registering the available components, as well as the method that we expost to the global Coveo scope.
For example, the
Coveo.executeQuery
function will be registed in this class by the QueryController.