Created
June 27, 2019 20:29
-
-
Save JasonStoltz/1785aa9f73ed9993301d6203345a1f93 to your computer and use it in GitHub Desktop.
Medium - Search UI - 1
This file contains hidden or 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
// Step #1, import Statements | |
import React from "react"; | |
import AppSearchAPIConnector from "@elastic/search-ui-app-search-connector"; | |
import { SearchProvider, Results, SearchBox } from "@elastic/react-search-ui"; | |
import { Layout } from "@elastic/react-search-ui-views"; | |
import "@elastic/react-search-ui-views/lib/styles/styles.css"; | |
// Step #2, The Connector | |
const connector = new AppSearchAPIConnector({ | |
searchKey: "[YOUR_SEARCH_KEY]", | |
engineName: "video-games", | |
hostIdentifier: "[YOUR_HOST_IDENTIFIER]" | |
}); | |
// Step #3: Configuration Options | |
const configurationOptions = { | |
apiConnector: connector | |
// Let's fill this in together. | |
}; | |
// Step #4, SearchProvider: The Finishing Touches. | |
export default function App() { | |
return ( | |
<SearchProvider config={configurationOptions}> | |
<div className="App"> | |
<Layout | |
// Let's fill this in together. | |
/> | |
</div> | |
</SearchProvider> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment