gabrielcsapo / docusaurus-plugin-search-local

An offline/local search plugin for Docusaurus v2
https://gabrielcsapo.github.io/docusaurus-plugin-search-local/
MIT License
25 stars 9 forks source link

Enable searching from the middle of the word? #47

Closed yudongqiu closed 2 years ago

yudongqiu commented 2 years ago

Reason: For technical terms, people may not remember the full name, but only parts. Searching parts in the middle of a long string does not show result.

Screenshots:

  1. search full term or prefix works: https://gabrielcsapo.github.io/docusaurus-plugin-search-local/search/?q=docsRouteBasePath

    Screen Shot 2022-04-19 at 2 44 09 PM
  2. Search part term does not show any result: https://gabrielcsapo.github.io/docusaurus-plugin-search-local/search/?q=RouteBasePath

Screen Shot 2022-04-19 at 2 44 47 PM

Just for comparison, the algolia search engine seems to support such use case: https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-pages#mdxPageComponent

Screen Shot 2022-04-19 at 2 48 04 PM
Ancient-Dragon commented 2 years ago

@gabrielcsapo / @lbdm44 Do you know if you're planning to implement this? Would be really beneficial, thanks!

gabrielcsapo commented 2 years ago

Looking into a fix now @Ancient-Dragon

gabrielcsapo commented 2 years ago

I created a PR for the fix. will update when we have a published version.