8000 [Integrations] Internal Search · Issue #682 · nuxtlabs/docus · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[Integrations] Internal Search #682

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

Closed
justindasilva opened this issue Nov 18, 2022 · 18 comments
Closed

[Integrations] Internal Search #682

justindasilva opened this issue Nov 18, 2022 · 18 comments
Assignees
Labels
enhancement New feature or request

Comments

@justindasilva
Copy link

I think it would be a cool feature to support an internal search in Docus.
One that didn't rely on Algolia.

Does Docus support module development?

I'm imagining being able to set search: true in the App Config for Docus and that would automatically throw a search box at the top of the site. Some process would be needed to index all the docs under /content and make it keyword searchable though.

@codebykenny
Copy link
Contributor

https://github.com/cmfcmf/docusaurus-search-local

Here is a Docusaurus equivalent of a local search we might draw inspiration from

@atinux
Copy link
Member
atinux commented Nov 24, 2022

Indeed, as easy start we can have an endpoint that leverage both navigation + parsing all documents from it to get the titles.

Then we could also pre-render the endpoint and have a command palette to easily navigate in it (ex: https://github.com/xiaoluoboding/vue-command-palette)

@atinux atinux added the enhancement New feature or request label Nov 24, 2022
@Tahul
Copy link
Contributor
Tahul commented Nov 27, 2022

I suggest moving this issue to Elements, as these components could be used in any theme.

@Tahul
Copy link
Contributor
Tahul commented Nov 27, 2022

WDYT @atinux

@atinux
Copy link
Member
atinux commented Nov 27, 2022

I think we can first bootstrap in Docus before moving the search endpoint into Nuxt Content.

I believe this should be part of Nuxt Content, not elements in long term.

Elements are made for components in Markdown.

@Hecatron
Copy link

This is something I've been interested in myself for my own blog.
Since I prefer a static file over algolia for a small amount of content.

FuseJS seems to be the more popular one at the moment for local searches

I think what you'd need is a seperate nuxt module

  • Perhaps search the markdown content with the query content api
  • Generate a json search index file for fusejs
  • Perhaps some sort of caching via tracking the modification date / time of the files in content
    To avoid looping over the same files on each build unless needed.

For the search control, something similar to this but for use by fusejs but with a bit of theming for docus

I suspect the only part that would be docus specific would be a themed control, with the rest of it being a nuxt module for use with the content module.

@Hecatron
Copy link
Hecatron commented Dec 8, 2022

Just to add for static sites (SSG)
lyrasearch seems quite promising

The parsedoc-plugin might allow it to be used just by scanning the markdown

@leeoniya
Copy link
leeoniya commented Dec 24, 2022

i've spent a lot of time comparing quite a few here, though it's skewed towards searching huge lists of phrases/terms/names rather than full document content (with stemming, stop words, word frequency, etc) like FlexSearch, Lyra, or Algolia.

https://github.com/leeoniya/uFuzzy#a-biased-appraisal-of-similar-work

@jaonoctus
Copy link

I'm offering a bounty of 4,000,000 sats (0.04 BTC) for this one 😄

Copy link
Member
atinux commented Mar 8, 2023

We will add native search in Content very soon.

Copy link
Contributor
Tahul commented Apr 18, 2023

Hey :) another bump there as we discussed this feature again recently;

As a reference, VitePress recently implemented local search using minisearch, and Volta docs are also using minisearch as the engine for local search in their docs!

I'm sure we could work on something that does the same for Docus, then maybe backport it as an extension for all themes/Nuxt Content projects!

Copy link
Contributor
Tahul commented May 17, 2023

Linked to nuxt-themes/elements#158

@Tahul Tahul changed the title Feature Request: Internal Search Internal Search May 17, 2023
@Tahul Tahul changed the title Internal Search [Feature Request] Internal Search May 17, 2023
Copy link
Contributor
Tahul commented May 17, 2023

From @otabekoff in #771 :

Does an offline search input feature exist? Or should it be implemented? I've seen that many of SSGs or Static documentation generators have this function. One example is Vuepress. Let's say I'm making an app that works offline using PWA or real app with Docus. What the user does to search? Uses page by page manual checking? In my opinion it is the most hardest way to do it.
You can look up the Vuepress repo for the logic. Both Docus and Vuepress uses Vue(or Nuxt).
EDIT: What about using DocSearch? I already know I can use Algolia. But it needs internet.

Copy link
Contributor
Tahul commented May 17, 2023

From @marvin-j97 in #771 :

I'm guessing this is a duplicate of #682 [Feature Request] Internal Search?
Nextra uses Flexsearch.
For Docusaurus, there are some plugins that use Lunr.
Edit: Vitepress now supports Offline Search using minisearch

@Tahul Tahul changed the title [Feature Request] Internal Search [Integrations] Internal Search May 17, 2023
@Hecatron
Copy link

I've been trying to write my own implementation using orama
https://github.com/oramasearch/orama

so far I've managed to generate a database for it using the nuxt content query API
I think in the case of the algolia (non local search) module, it scrapes the html of the page instead at build time.
Although by using the nuxt content query api you can split the generated database based on headers.
What I'm lacking at the moment is the frontend bit which I need to work on

What I'm aiming for ideally is something that looks like what you get with mkdocs material, where it lists the header then the content underneath
image

@Barbapapazes
Copy link
Contributor

nuxt-themes/elements#158

Hello @atinux, have you an idea when this will landed? I've deep dive into the VitePress implementation and using a server route and the cache storage, we could build the index used by MiniSearch.

Copy link
Member
atinux commented Jun 30, 2023

It's coming very soon via #930 , see a demo on: https://unstorage-q6va4ddjb-nuxt-js.vercel.app/ (see pr

Copy link
Contributor

that's niiiice

@larbish larbish closed this as completed Jun 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

10 participants
0