Package Exports
- @elastic/search-ui-site-search-connector
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@elastic/search-ui-site-search-connector) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
search-ui-site-search-connector
Part of the Search UI project.
This Connector is used to connect Search UI to Elastic's Site Search API.
While Site Search supports multiple document types, Search UI will only support a single document type, and it must be provided up front when creating the connector.
Note that Site Search does not support certain features of Search UI:
disjunctiveFacetsordisjunctiveFacetsAnalyticsTagsconfiguration options- Only
valuefacets are allowed, norangefacet support. sortoption is not supported on facets.sizeoption is not supported on facets.- Does not support multiple filters applied to a single field.
- Cannot apply more than 1 range filter on a single field.
- Analytics tags are not supported in
click. suggestionsare not supported in autocomplete, onlyresults- The
nonefilter type is not supported.
Usage
npm install --save @elastic/search-ui-site-search-connectorimport SiteSearchAPIConnector from "@elastic/search-ui-site-search-connector";
const connector = new SiteSearchAPIConnector({
documentType: "national-parks",
engineKey: "Z41R5U3Hi4s5gp1aw7kA"
});Classes
- SiteSearchAPIConnector
Typedefs
- next :
function - hook :
function - Options
SiteSearchAPIConnector
new SiteSearchAPIConnector(options)
| Param | Type |
|---|---|
| options | Options |
next : function
Kind: global typedef
| Param | Type | Description |
|---|---|---|
| updatedQueryOptions | Object |
The options to send to the API |
hook : function
Kind: global typedef
| Param | Type | Description |
|---|---|---|
| queryOptions | Object |
The options that are about to be sent to the API |
| next | next |
The options that are about to be sent to the API |
Options
Kind: global typedef
| Param | Type | Default | Description |
|---|---|---|---|
| documentType | string |
Document Type found in your Site Search Dashboard | |
| engineKey | string |
Credential found in your Site Search Dashboard | |
| beforeSearchCall | hook |
(queryOptions,next)=>next(queryOptions) |
A hook to amend query options before the request is sent to the API in a query on an "onSearch" event. |
| beforeAutocompleteResultsCall | hook |
(queryOptions,next)=>next(queryOptions) |
A hook to amend query options before the request is sent to the API in a "results" query on an "onAutocomplete" event. |