Skip to content

Instantly share code, notes, and snippets.

<NumericRefinementListFilter
id="booksCount"
title="Books Count"
field="books_count"
options={[
{ title: 'All' },
{ title: 'up to 50', from: 0, to: 50 },
{ title: '51 to 100', from: 51, to: 100 },
{ title: '100 or more', from: 101, to: 10000 },
]}
<RangeSlider
dataField="original_publication_year"
range={{
start: 1880,
end: 2019,
}}
rangeLabels={{
start: '1880',
end: '2019',
}}
<RangeFilter
min={1880}
max={2019}
field="original_publication_year"
id="publicationYear"
title="Publication Year"
showHistogram
/>
<MultiList
dataField="authors.keyword"
showSearch={false}
title="Authors"
componentId="authors"
queryFormat="or"
/>
<RefinementListFilter
id="authors"
title="Authors"
field="authors.keyword"
operator="OR"
size={10}
/>
<div className={container}>
<ReactiveList
pagination
componentId="results"
react={{
and: ["search"]
}}
dataField="title.keyword"
>
{({ loading, data, error }) => {
const ResultCard = props => {
const {
result: { _id, _source },
} = props;
return (
<div className={resultCard} key={_id}>
<img src={_source.image} alt={_source.title} />
<h1>{_source.title}</h1>
</div>
);
<div className={container}>
<div className={resultWrapper}>
<Hits hitsPerPage={50} highlightFields={['title']} itemComponent={ResultCard} />
</div>
<Pagination showNumbers />
<NoHits
translations={{
'NoHits.NoResultsFound': 'No movies found were found for {query}',
'NoHits.DidYouMean': 'Search for {suggestion}',
'NoHits.SearchWithoutFilters': 'Search for {query} without filters',
<DataSearch
dataField={['title', 'title.autosuggest', 'title.keyword', 'authors', 'authors.keyword','authors.autosuggest']}
fieldWeights={[2,1,2,2,1,2]}
componentId="search"
autosuggest={false}
placholder="Search for book title & Authors"
/>
<SearchBox
searchOnChange
queryOptions={{ analyzer: 'standard' }}
queryFields={['title^5', 'authors']}
placeholder="Search Book title & Authors"
/>