@elastic/search-ui-site-search-connector
v1.22.0
Published
A Search UI connector for Elastic's Site Search Service
Downloads
5,413
Maintainers
Keywords
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:
disjunctiveFacets
ordisjunctiveFacetsAnalyticsTags
configuration options- Only
value
facets are allowed, norange
facet support. sort
option is not supported on facets.size
option 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
. suggestions
are not supported in autocomplete, onlyresults
- The
none
filter type is not supported.
Usage
npm install --save @elastic/search-ui-site-search-connector
import SiteSearchAPIConnector from "@elastic/search-ui-site-search-connector";
const connector = new SiteSearchAPIConnector({
documentType: "national-parks",
engineKey: "Z41R5U3Hi4s5gp1aw7kA"
});
Classes
Typedefs
SiteSearchAPIConnector
Kind: global class
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. |