diff --git a/src/components/search/index.tsx b/src/components/search/index.tsx index f5b53f23e..eed87cb45 100644 --- a/src/components/search/index.tsx +++ b/src/components/search/index.tsx @@ -10,7 +10,7 @@ import { Configure, InstantSearch, ClearRefinements, - SortBy, + useInstantSearch, } from 'react-instantsearch' import {get, isEmpty} from 'lodash' import {useToggle} from 'react-use' @@ -28,7 +28,11 @@ import cx from 'classnames' import NewCuratedTopicPage from './curated/[slug]' import Link from 'next/link' import analytics from '@/utils/analytics' -import {SORT_PRESETS} from '@/utils/typesense' +import { + typsenseAdapterConfig, + TYPESENSE_COLLECTION_NAME, +} from '@/utils/typesense' +import {typesenseAdapter} from '@/pages/q/[[...all]]' type SearchProps = { searchClient?: any @@ -157,6 +161,53 @@ const Search: FunctionComponent> = ({ ) } + const PresetOptions = () => { + const {refresh} = useInstantSearch() + + return ( + + ) + } + const RefinementsDesktop = () => { return (