Socket
Socket
Sign inDemoInstall

hire-faceted-search

Package Overview
Dependencies
9
Maintainers
2
Versions
66
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    hire-faceted-search


Version published
Weekly downloads
66
increased by6500%
Maintainers
2
Install size
2.98 MB
Created
Weekly downloads
 

Changelog

Source

v7.0.1 (2017/2/6 16:38)

  • Bump hire-*

Readme

Source

build status

A faceted search React component.

Config for publications

import FacetedSearch from "hire-faceted-search";

// Basic search configuration
let searchConfig = {
    // Base URL
    baseURL: "http://(...)/v2",
    // API path
    searchPath: "search/path",
    // Provide a VRE ID for headers
    headers: {VRE_ID: "VreId"}
};

// Labels for human presentation of metadata labels (key = facets[n].name and refs[n].data[key])
let labels = {
	facetTitles: {
		"dynamic_s_creator": "Author",
		...
	}
};

// Controlled list of facet filters (default = all)
let facetList = ["dynamic_s_creator", ...];

// Metadata fields to be presented with result (default = all)
let metadataList = ["createdBy", ...];


React.render(<FacetedSearch
	config={searchConfig}
	facetList={facetList}
	labels={labels}
	metadataList={metadataList}
	onChange={function(data) {console.log(data)}}
	onSelect={this.gotodoc.bind(this)}
	 />, document.body);

Props

className              Add a custom className to root el.

config                 Map of config options.

customComponents       Map of custom components. Currently supported:
                       currentQuery, filters and result.

facetList              List of facet names. Determines order.

facetSortMap           Map of sort types. Keys are facet names,
                       values are maps with a `direction` and `type` key.

labels                 Map of labels. Used when the server doesn't
                       return a title for a facet. Or for i18n.

metadataList           List of metadata to be shown per result.

numberedResults        Boolean. Show <ol> or <ul> result list.

onChange               Function. Called when a new search result
                       is received. Returns the search results.

onSearchId             Function. Called when a new search result
                       is received. Returns the search ID.

onSelect               Function. Called when user click or touches
                       (selects) a search result.

query                  Map of query parameters. Usually the query
                       parameters are internal. In case of a forced
                       rerender or when passing queries from one
                       search to the other, passing a query via
                       props becomes necessary.

Config

baseURL                Base of the search URL.

fullTextSearchFields   List of full text search fields. Consists
                       of maps with name and position key.

headers                Map of custom headers.

hideFreeTextSearch     Boolean to show/hide full text search.

queryDefaults          Map of search query defaults.

rows                   Number of rows per result list.

searchPath             Path of the search URL.

FAQs

Last updated on 06 Feb 2017

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc