🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@elastic/search-ui

Package Overview
Dependencies
Maintainers
59
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@elastic/search-ui

A Headless Search UI library

1.0.0-canary.3
Source
npm
Version published
Weekly downloads
122K
19.64%
Maintainers
59
Weekly downloads
 
Created
Source

search-ui

Part of the Search UI project.

The "Headless Search UI" that serves as a foundation for the react-search-ui library.

If you are not using React, this library can be used in conjunction with any other framework. Instead of working with components as you do in React, you simply work directly with state and actions. These are documented in the Search UI core section of the react-search-ui README.

You'll get all of the benefit of Search UI, just with no view. The view is up to you.

Usage

npm install --save @elastic/search-ui
import { SearchDriver } from "@elastic/search-ui";
import AppSearchAPIConnector from "@elastic/search-ui-app-search-connector";

const connector = new AppSearchAPIConnector({
  searchKey: "search-371auk61r2bwqtdzocdgutmg",
  engineName: "search-ui-examples",
  hostIdentifier: "host-2376rb"
});

const config = {
  apiConnector: connector
};

const driver = new SearchDriver(config);

driver.subscribeToStateChanges(state =>
  console.log(`Received ${state.totalResults} results for your search!`)
);

driver.getActions().setSearchTerm("canyon");

// Received 8 results for your search!

Configuration

All configuration is documented in the Search UI Configuration section of the react-search-ui README.

SearchDriver Usage

Methods

methodparamsreturndescription
subscribeToStateChangesfunctionFunction to execute when state changes. ex.

(state) => {}
getActionsObjectActionsAll available actions.
getStateStateCurrent state.

Does Search UI use telemetry?

If you are using the App Search or Site Search connector, we pass along 2 headers on API requests that identify them as Search UI requests. This ONLY happens if you are using our pre-built connectors.

Ex.

x-swiftype-integration: search-ui
x-swiftype-integration-version: 0.6.0

FAQs

Package last updated on 15 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts