TLDR Nacho encountered issues with migrating search from Algolia to Typesense, including a custom component that interfered with the search and an incorrect element being used as the title. Jason provided guidance on removing the component and adjusting search configuration.
Oops, it should be this:
Will fix that comment
awesome thanks, sent you a DM here in slack but I already found my way mostly
will ask here if any more questions arise
running the scraper now
I was just typing this out… We don’t have a migration guide for Docusaurus per se, because it’s just a “fresh new integration”, when you follow that step-by-step guide which you’re following
yep perfect
where do I access the features you showed of pinning and synonyms and such?
It’s under “Curation” on the left panel
oh right it was greyed out because I was still scrapping whoops
okay will take a look scrapping it’s getting there already
okay how do I now replace the algolia search with the typesense search? I feel like I did here but I might be missing something else?
sorry if it’s a noob question :smile:
Yup that should be it
well for some reason it wasn’t, I’m still seeing the algolia search on my preview url
but no results :smile:
which makes sense since I removed my algolia key and such
Is it showing up locally?
Another thing to try, is first turning off the Algolia search bar completely
Make sure that works as expected, without any errors
And then install the typesense theme
hmm
how do I do that?
Looks like just removing the `algolia` key from the docusaurus theme config might do it?
hmm seems like we have some config on top that might be it
seems like we had a custom component to show algolia that’s why it was showing
but after removing it, not sure how to get back to the default so typesense would show by default
(as you can see, I didn’t set this up initially)
Ok once you’ve removed it, does the search bar disappear locally?
yes
Ok cool
Now if you add the typesense specific config and theme, does it show up now?
didn’t remove it, do you want me uninstall the theme and add it again?
Did you restart the docusaurus dev server?
this was the culprit
yeah
I think the problem is that we’re rendering a custom navbar
so that might be out of scope for you
Yeah, and also out of my docusaurus knowledge :sweat_smile:
I’ll figure it out, will update :smile:
well now I have the search, just need to have the things I had in my navbar back
That was fast!
yeah just had to delete the component
basically because I had a SearchBar component, it was getting replaced
okaaay all fixed
now onto the fun stuff with personalization and setting the github action
my scrapper has been running for like 90 mins I feel like
oh just finished
any idea why some results instead of sending me to the page they sent me here?
(see url)
Could tell me the search term that generates those URLs?
“ui components”
The first two links in the search results essentially point to the home page, and that tile doesn’t have any anchor / link to point the user to
ohh so that’s what it’s getting linked to
yup
I’d recommend excluding the home page from search results
yeah, did with base config first to start
not sure why it doesn’t find this page
how do I exclude homepage?
the config file is incredibly cumbersome
You want to use `stop_urls`
so just `"stop_urls": [` `"/tests", "/"` `],`
?
add the “/”
oh no\
that wont work
Might have to use regex to make sure it only matches the home page
that was exactly what I was looking at
also, does this look correct to you?
in the hierarchy sense
what’s important is the “useContract() function”
and that’s hierarchy lvl2
(getting deep now in the config stuff)
In the Typesense Cloud dashboard, it by default searches only the first 3 fields. But in docsearch there’s a specific field priority order defined
So what you see in the actual docsearch UI will return results in that priority order, which will be different from what you see in the dashboard….
Unless of course you setup the dashboard to mimic those same settings used in docusaurus
not sure I follow
so my results in the cloud dashboard will differ to what I see in my site?
that’s what you’re saying right
correct
If you scroll to the bottom of the search page in the cloud dashboard, you’ll see the search settings used
Those are different from what the docusaurus-typesense plugin uses at runtime
right, and how do I sync them? I can do that with the preset thing you told me right?
Yup!
I would recommend starting out with the default config from the docsearch plugin. If you look at the network requests sent to Typesense in the browser’s dev console, you’ll see all the default values for all the search parameters
I feel like prioritizing lvl2 is what’s giving me best results
but that might be a problem with how stuff is set up in docusaurus?
You could try changing it and see what the impact is…
because pages like this
the title is an h2
when it should be an h1
sorry if I’m bothering you with my thoughts here
I’d recommend updating the markup if that’s an option
No worries!
hmm yeah that might be an option I need to check the autogeneration
okay let’s say I can’t do that (not sure yet)
if I say okay I want this
how do I set it up on docusaurus to be like this?
I create the preset
Then in this line, you’d add that preset name:
do you have an example? I don’t see preset on any of the examples
also, is this scoped to _everything_ or can I do only for certain url scopes like with the hieararchies?
This will be scoped to everything…
I don’t have an example unfortunately
do you think someone can get me one? :smile: not sure what the syntax is supposed to be
`typesenseSearchParameters: {"preset": "lvl2-priority"}`
In
okay nice awesome
thanks
Nacho
Thu, 09 Feb 2023 21:47:19 UTCjust noticed this url goes nowhere, does anyone have the updated link?