App Search Connector
This Connector is used to connect Search UI to Elastic's App Search API.
Usage
npm install --save @elastic/search-ui-app-search-connector
import AppSearchAPIConnector from "@elastic/search-ui-app-search-connector";
const connector = new AppSearchAPIConnector({
searchKey: "search-371auk61r2bwqtdzocdgutmg",
engineName: "search-ui-examples",
endpointBase: "http://127.0.0.1:3002"
});
Additional options
Additional options will be passed through to the underlying APIclient. Any valid parameter of the client can be used.
const connector = new AppSearchAPIConnector({
searchKey: "search-371auk61r2bwqtdzocdgutmg",
engineName: "search-ui-examples",
endpointBase: "http://127.0.0.1:3002",
cacheResponses: false
});
Options
Param | Description |
---|---|
searchKey | Required. String. Credential found in your App Search Dashboard |
engineName | Required. String. Engine to query, found in your App Search Dashboard |
endpointBase | Required. String. Endpoint path, found in your App Search Dashboard |
cacheResponses | Optional. Boolean. Default is true. By default, connector will keep an in browser memory result cache of previous requests. |
hostIdentifier | Optional. Useful when proxying the Swiftype API or developing against a local API server. |
beforeSearchCall | Optional. A hook to amend query options before the request is sent to the API in a query on an "onSearch" event. |
beforeAutocompleteResultsCall | Optional. A hook to amend query options before the request is sent to the API in a "results" query on an "onAutocomplete" event. |
beforeAutocompleteSuggestionsCall | Optional. A hook to amend query options before the request is sent to the API in a "suggestions" query on an "onAutocomplete" event. |