+
+
+
- const rebuildIndex = (searchableData) => {
- const {removeStopWords, selectedStrategy, selectedSanitizer, termFrequency} = searchState
- const dataToSearch = new JsSearch.Search("title")
- dataToSearch.addIndex('title')
+
- dataToSearch.addDocuments(searchableData)
- setSearchState({
- ...searchState,
- isLoading: false,
- search: dataToSearch
- })
- }
-
- const searchData = e => {
- const {search} = searchState
- const queryResult = search.search(e.target.value)
- setSearchState({
- ...searchState,
- searchQuery: e.target.value,
- searchResults: queryResult
- })
- }
- const handleSubmit = (e) => {
- e.preventDefault()
- }
-
- return (
-
- )
+
+
+
+
+ )
}
-
-const ResultList = ({searchResults}) => {
- return (