Hi, I my planning to migrate my site from algolia ...
# community-help
a
Hi, I my planning to migrate my site from algolia to typesense. It is possible to implement Typesense with nuxtjs 3 using vue-instansearch with SSR? My plan is to feed the search and the display of all the produtcs with SEO. I did find and try our demo: https://guitar-chords-search-nuxt-js.typesense.org/ But it lacks the SSR and vue-route features. Can anyone help? Or where can i find help Regards, Araldo Fidalgo
j
CC: @Hayden Hoang
h
Hi @Araldo Fidalgo, is your site currently using Algolia with Nuxt3 SSR?
a
HI @Hayden Hoang
No, now i am using Nuxt2 with Algolia. I testing https://algolia.nuxtjs.org/advanced/vue-instantsearch/, and it is going ok i am testing this one: https://www.algolia.com/doc/guides/building-search-ui/going-further/routing-urls/vue/#combining-with-nuxtjs , that is very similar to the nuxt2 implementation with AisInstantSearchSsr and createServerRootMixin
h
@Araldo Fidalgo
I testing https://algolia.nuxtjs.org/advanced/vue-instantsearch/, and it is going ok
We have a typesense-instantsearch-adapter library that you can plug in the
searchClient
in
createServerRootMixin
without the need for Algolia Nuxt module.
Copy code
import TypesenseInstantSearchAdapter from 'typesense-instantsearch-adapter';

export const typesenseInstantsearchAdapter = () => {
  const config = useRuntimeConfig();
  return new TypesenseInstantSearchAdapter({
    server: {
      apiKey: config.public.PUBLIC_TYPESENSE_SEARCH_ONLY_API_KEY || 'xyz',
      nodes: [
        {
          url:
            config.public.PUBLIC_TYPESENSE_SERVER_URL ||
            '<http://localhost:8108>',
        },
      ],
    },
    additionalSearchParameters: {
      query_by: '',
    },
  });
};
const searchClient = typesenseInstantsearchAdapter().searchClient;

const serverRootMixin = ref(
  createServerRootMixin({
    searchClient,
    indexName,
  })
);
@Araldo Fidalgo I have updated the guitar chords demo to use SSR here. Check it out! https://github.com/typesense/showcase-guitar-chords-search-nuxt-js/pull/3
a
Hi, @Hayden Hoang I going to test it. 👍
Hi, @Hayden Hoang with some changes i think it is working. view-source:https://scfnuxt3pt-slot2-c7fub7b9arbwexfd.westeurope-01.azurewebsites.net/?guitar-chords%5BrefinementList%5D%5Bkey%5D%5B0%5D=G&amp;guitar-chords%5BrefinementList%5D%5Bsuffix%5D%5B0%5D=sus2 But i have some questions. if you don't mind... The source file contains huge data in the script with the id="__NUXT_DATA__" I think that it is the data that useAsyncData gets on first load for the SSR? This it be change? My test project: https://github.com/lacral/nuxt-typesense-instansearch Regards, Araldo Fidalgo
h
The source file contains huge data in the script with the id="__NUXT_DATA__"
I think that it is the data that useAsyncData gets on first load for the SSR?
This it be change?
Yes, that script contains the application state to hydrate on the client. The amount of data depends on how big a single hit document is and the number of hits per page, e.g...
a
👍