-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
semantic search urls #29
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/eggheadio/egghead-io-nextjs/792adst78 |
return slug.split('+').map(decodeURIComponent).join(' ') | ||
} | ||
|
||
export const createUrl = (searchState) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all of this gets a little gross, but it has tests ;)
src/pages/search/[[...all]].tsx
Outdated
router.push(href, href, { | ||
shallow: true, | ||
}) | ||
// router.push(href, href, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
killed this for testing purposes
My suggestion is to kill all the slashes and use a different delimiter. The goal is just and English phrase slugified |
My suggestion is to kill all the slashes and use a different delimiter. The goal is just an English phrase slugified |
@jaredpalmer I used Is that any better? we've got |
actually I like |
The closer to English the better. react-and-amplify |
return ( | ||
<div> | ||
<NextSeo noindex={!isEmpty(searchState.query)} title={pageTitle} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the user has typed in a query we don't want to index anything. We only index when they have applied certain refinements and no query.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Loving this. Tests are ace.
I didn't realize algolia did so much of the heavy lifting of parsing out garbage in queries and returning facets. This makes this way easier than I was thinking.
This is exploring some of the ideas around "semantic URLs" for site search that are friendly to google.
Basically taking the URL and parsing into Algolia params and then back again.