Refreshing `react-instantsearch` Component Dynamically.
TLDR robert asked how to trigger a refresh of react-instantsearch
to display dynamic uploads. Jason suggested using the refresh
prop.
Jul 13, 2022 (18 months ago)
robert
08:06 PMreact-instantsearch
? my use case is i'm adding documents dynamically via an upload & i want the component to show the latest. I know it isn't exactly a typesense issue but figured I'd ask here anywaysconst CustomHits = connectHits(Hits);
const SearchBox = connectSearchBox(Box);
export const Search = ({ onSelect = null }: { onSelect: any }) => {
const { organization } = useActiveOrganization();
return (
<InstantSearch
indexName="files"
searchClient={typesenseInstantSearchAdapter.searchClient}
>
<Configure filters={`org_id:${organization?.id}`} />
<div className="sticky top-0 bg-white">
<SearchBox />
</div>
<CustomHits setClickedHit={onSelect} />
</InstantSearch>
);
};
I'm using the typesense adapter here.
Jason
11:32 PMrefresh
prop: https://www.algolia.com/doc/api-reference/widgets/instantsearch/react/#widget-param-refreshTypesense
Indexed 3005 threads (79% resolved)
Similar Threads
Connecting React Instant Search with Typesense Adapter
KARTHICK sought help with an error when using Typesense Adapter for React Instant Search. Jason advised substituting import statements. After uninstalling the react-instantsearch-dom package, KARTHICK resolved the issue.
Implementing Search Suggestion/Autocomplete Functionality in Typesense
Denis needed advice on implementing search suggestions in Typesense. Jason provided a solution for fetching after 3+ letters. However, questions on design pattern and passing hooks remain unanswered.
Query on Menu RefinementList and Usage of Typesense with React-InstantSearch-Hooks
Dipankar wanted to refine menus using `react-instantsearch-dom` and inquired on Typesense's compatibility with `react-instantsearch-hooks`. Jason recommended using `connectCurrentRefinements` and confirmed Typesense's compatibility.