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

feat: add search #2146

Merged
merged 45 commits into from Oct 27, 2023
Merged

feat: add search #2146

merged 45 commits into from Oct 27, 2023

Conversation

Barbapapazes
Copy link
Contributor

@Barbapapazes Barbapapazes commented Jul 6, 2023

πŸ”— Linked issue

fix #1758
fix #1507
fix #553

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This PR add support full-text search.

  • Support MiniSearch with or without index
  • Return json content to use with any full-text-search

Appreciate feedback πŸ™ to improve usage. Once validate, I will write the documentation.

An example of usage : Barbapapazes/esteban-soubiran.site#477

Heavily inspired by the work of @Tahul in nuxt-themes/docus#930 and the local search of VitePress

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@nuxt-studio
Copy link

nuxt-studio bot commented Jul 6, 2023

βœ… Live Preview ready!

Name Edit Preview Latest Commit
content Edit on Studio β†—οΈŽ View Live Preview 122aef4

@netlify
Copy link

netlify bot commented Jul 6, 2023

βœ… Deploy Preview for nuxt-content ready!

Built without sensitive environment variables

Name Link
πŸ”¨ Latest commit 7e45557
πŸ” Latest deploy log https://app.netlify.com/sites/nuxt-content/deploys/6506b1c1ebd5010008c8c1fd
😎 Deploy Preview https://deploy-preview-2146--nuxt-content.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@nuxt-studio
Copy link

nuxt-studio bot commented Jul 6, 2023

βœ… Live Preview ready!

Name Edit Preview Latest Commit
content Edit on Studio β†—οΈŽ View Live Preview 7525146

src/module.ts Outdated Show resolved Hide resolved
@Barbapapazes
Copy link
Contributor Author

I'm looking for a better way to return content in order to allow access to sub title.

@Barbapapazes
Copy link
Contributor Author

I'm looking for a better way to return content in order to allow access to sub title.

I think that I will pivot to Minisearch https://lucaongaro.eu/blog/2019/01/30/minisearch-client-side-fulltext-search-engine.html

@Barbapapazes Barbapapazes marked this pull request as draft July 6, 2023 15:07
src/runtime/server/api/search.ts Outdated Show resolved Hide resolved
src/module.ts Outdated Show resolved Hide resolved
@Barbapapazes Barbapapazes marked this pull request as ready for review July 7, 2023 07:34
package.json Outdated Show resolved Hide resolved
src/module.ts Outdated Show resolved Hide resolved
Barbapapazes and others added 2 commits September 16, 2023 18:09
Co-authored-by: nobkd <44443899+nobkd@users.noreply.github.com>
@Barbapapazes
Copy link
Contributor Author

Hello @Atinux,

Sorry, I take some times to improve this PR! I've written documentation but I'm open to suggestions.

Co-authored-by: nobkd <44443899+nobkd@users.noreply.github.com>
Copy link
Member

Atinux commented Sep 18, 2023

I will wait for @farnabaz deep review since he is the lead of Nuxt Content

src/module.ts Outdated Show resolved Hide resolved
@Barbapapazes
Copy link
Contributor Author

Hello,

I refactor a lot using your comments @farnabaz! Hope this is better now!

@farnabaz
Copy link
Member

Thanks @Barbapapazes,
Looks good to me, I'll move the module option under experimental, and we will make it an official feature in v3

@farnabaz farnabaz merged commit f40e1a1 into nuxt:main Oct 27, 2023
2 checks passed
@farnabaz farnabaz mentioned this pull request Oct 27, 2023
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.

.search() for query (nuxt-content v2) Searching for a text in markdown search by index using fuse.js
4 participants