JSPM

  • Created
  • Published
  • Downloads 1841
  • Score
    100M100P100Q123700F
  • License Apache-2.0

A Search UI connector for Elastic's Site Search Service

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

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 that App Search does provide. For example:

  • Only value facets are allowed, not range facets.
  • Analytics tags are not supported.
  • Facets do not have a configurable "size" parameter.
  • Disjunctive faceting is not supported.

Usage

npm install --save import @elastic/search-ui-site-search-connector
import SiteSearchAPIConnector from "@elastic/search-ui-site-search-connector";

const connector = new SiteSearchAPIConnector({
  documentType: "national-parks",
  engineKey: "Z41R5U3Hi4s5gp1aw7kA"
});

Configuration

option type required? source
documentType String required From your Site Search Account's Credentials
engineKey String required From your Site Search Engine's Name
additionalOptions Function(Object) optional A hook that allows you to inject additional, API specific configuration.

currentOptions => ({ someOption: 'a' })
options before the request is sent to the server.

Methods

method params return description
click props - Object
- query - String
- documentId - String
search searchTerm - String
searchOptions - Object
ResultList

ResultList

field type description
rawResults Array[Object] Raw list of result data: Reference
results Array[ResultItem]
info Object meta data from response: Reference

ResultItem

field type description
data Array[Object] Raw result data: Reference
getRaw Function(String) Convenience function for getting raw field data
getSnippet Function(String) Convenience function for getting snippet field data