This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useEffect, useState } from 'react' | |
import PropTypes from 'prop-types' | |
import styled, { withTheme } from 'styled-components' | |
import { withSearch } from '@elastic/react-search-ui' | |
import _get from 'lodash/get' | |
import Slider from 'rc-slider' | |
import 'rc-slider/assets/index.css' | |
import { FacetContainer, FacetHeader } from './SearchFacet' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
/** | |
* Install: | |
* | |
* Download this file and give it executuable persmissions | |
* | |
* Usage: | |
* | |
* Uploading documents |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ... | |
<Layout | |
// ... | |
header={<SearchBox autocompleteSuggestions={true} />} | |
/> | |
// ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const configurationOptions = { | |
// ... | |
autocompleteQuery: { | |
suggestions: { | |
types: { | |
documents: { | |
// Which fields to search for suggestions. | |
fields: ["name"] | |
}, | |
// How many suggestions appear. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Layout | |
header={<SearchBox />} | |
bodyContent={<Results titleField="name" urlField="image_url" />} | |
sideContent={ | |
<div> | |
<Sorting | |
label={"Sort by"} | |
sortOptions={[ | |
{ | |
name: "Relevance", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
PagingInfo, | |
ResultsPerPage, | |
Paging, | |
Facet, | |
SearchProvider, | |
Results, | |
SearchBox, | |
Sorting | |
} from "@elastic/react-search-ui"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { SearchProvider, Results, SearchBox } from "@elastic/react-search-ui"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default function App() { | |
return ( | |
<SearchProvider config={configurationOptions}> | |
<div className="App"> | |
<Layout | |
header={<SearchBox />} | |
// titleField is the most prominent field within a result: the result header. | |
bodyContent={<Results titleField="name" urlField="image_url" />} | |
/> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const configurationOptions = { | |
apiConnector: connector, | |
searchQuery: { | |
search_fields: { | |
// 1. Search by name of video game. | |
name: {} | |
}, | |
// 2. Results: name of the video game, its genre, publisher, scores, and platform. | |
result_fields: { | |
name: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const connector = new AppSearchAPIConnector({ | |
searchKey: "[YOUR_SEARCH_KEY]", | |
engineName: "video-games", | |
hostIdentifier: "[YOUR_HOST_IDENTIFIER]" | |
}); |
NewerOlder