wilhelmer / mkdocs-localsearch

A MkDocs plugin to make the native "search" plugin work locally (file:// protocol)
MIT License
32 stars 8 forks source link

add useCustomSearch option to prevent from overwriting __search metho… #14

Closed MtShan closed 3 years ago

MtShan commented 3 years ago

I customized search query transformation because it is needed for Japanese full-text search. Japanese does not use any spaces between words, so splitting sentence to words (segmentation) is not an easy job. Segmentation result strongly depends on segmentation library. MkDocs Material use Lunr for searching, and Lunr use TinySegmenter for Japanese segmentation. So, we need to use TinySegmenter for search query segmentation. That is why I made issue and I made pull request. Please review my pull request and I hope you accept my proposal. Thank you for your useful plug-in.