Skip to content
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

Merged
merged 17 commits into from
Aug 18, 2020
Merged

semantic search urls #29

merged 17 commits into from
Aug 18, 2020

Conversation

joelhooks
Copy link
Contributor

@joelhooks joelhooks commented Aug 17, 2020

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.

@vercel
Copy link

vercel bot commented Aug 17, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/eggheadio/egghead-io-nextjs/792adst78
✅ Preview: https://egghead-io-nextjs-git-jh-search-urls-and-titles.eggheadio1.vercel.app

return slug.split('+').map(decodeURIComponent).join(' ')
}

export const createUrl = (searchState) => {
Copy link
Contributor Author

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 ;)

router.push(href, href, {
shallow: true,
})
// router.push(href, href, {
Copy link
Contributor Author

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

@jaredpalmer
Copy link

My suggestion is to kill all the slashes and use a different delimiter. The goal is just and English phrase slugified

@jaredpalmer
Copy link

jaredpalmer commented Aug 17, 2020

My suggestion is to kill all the slashes and use a different delimiter. The goal is just an English phrase slugified

@joelhooks
Copy link
Contributor Author

@jaredpalmer I used ~~t~~ instead, where ~~ is a replacement for the /

Is that any better? we've got type, tag, query, and instructor currently as the facets...

@joelhooks
Copy link
Contributor Author

actually I like -- better A E S T H E T I C A L L Y

@jaredpalmer
Copy link

The closer to English the better.

react-and-amplify
videos-by-dan-abramov
react-and-redux-videos-by-kent-c-dodds
react-hooks-and-redux-and-netlify

return (
<div>
<NextSeo noindex={!isEmpty(searchState.query)} title={pageTitle} />
Copy link
Contributor Author

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.

@joelhooks joelhooks changed the title RFC: test out semantic search url parsing semantic search urls Aug 18, 2020
@vercel vercel bot temporarily deployed to Preview August 18, 2020 04:43 Inactive
Copy link
Contributor

@johnlindquist johnlindquist left a 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.

@kodiakhq kodiakhq bot merged commit 47f5b9e into main Aug 18, 2020
@kodiakhq kodiakhq bot deleted the jh/search-urls-and-titles branch August 18, 2020 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants