Connecting React Instant Search with Typesense Adapter
TLDR 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.
1
May 25, 2023 (6 months ago)
KARTHICK
10:54 AM• If we need React instant search web hook widget we need to connect through algolia search alone.
import algoliasearch from 'algoliasearch/lite';
import { InstantSearch, SearchBox } from 'react-instantsearch-hooks-web';
const searchClient = algoliasearch('undefined', 'undefined');
function App() {
return (
<InstantSearch searchClient={searchClient} indexName="instant_search">
<SearchBox />
</InstantSearch>
);
}
• Right now in using typesense-instantsearch-adapter with react instant search dom.
• If any one know solution for this please reply in the thread.
Kishore Nallan Jason
Jason
03:34 PMJason
03:35 PMJason
03:35 PMMay 26, 2023 (6 months ago)
KARTHICK
04:21 AMimport { InstantSearch } from 'react-instantsearch-dom';
to
import { InstantSearch } from 'react-instantsearch-hooks-web';
Im getting this error
KARTHICK
04:23 AMJason
04:27 AMKARTHICK
04:34 AMconst typesenseInstantsearchAdapter = new TypesenseInstantSearchAdapter({
server: typesenseSearchClient.server,
apiKey: typesenseSearchClient.apiKey,
additionalHeaders: {
'X-Custom-Header': 'Value'
}
});
const App = () => {
return (
<InstantSearch
indexName="your_typesense_index_name"
searchClient={typesenseInstantsearchAdapter}
>
<SearchBox />
<Hits />
</InstantSearch>
);
};
KARTHICK
04:34 AMKARTHICK
04:47 AM1
Typesense
Indexed 3011 threads (79% resolved)
Similar Threads
Issue with Typesense Instantsearch and Upgrading to React 18
Carl experienced problems updating packages for a project. VIVEK suggested disabling reactStrictMode, while Jason insisted on downgrading to React 17 due to compatibility issues. Carl eventually found a workaround.
Resolving Issue with Typesense and React Search Integration
Dipankar experienced issues with a search function using `typesense-instantsearch-adapter` & `react-instantsearch-dom`. robert solved the problem by suggesting to downgrade react version to 17.x from 18.x.
Issues with Typesense Frontend Search Integration
Akash experienced issues integrating Typesense into their frontend search, particularly with their search box. Jason guided them to troubleshoot, eventually identifying the issue to be with react-instantsearch-dom and suggesting a downgrade to react 17, which 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.
Handling Exceptions with Typesense.js
Carl has problems handling typesense.js exceptions. Jason suggests handling it via InstantSearch and a feature request for the hooks library could expose the issue.