vuepress / ecosystem

Official plugins and themes for VuePress2
https://ecosystem.vuejs.press
MIT License
21 stars 26 forks source link

feat: init flexsearch plugin #91

Open svalaskevicius opened 3 months ago

svalaskevicius commented 3 months ago

Before submitting the PR, please make sure you do the following

What is the purpose of this pull request?

Description

Adds flexsearch plugin

Mister-Hope commented 3 months ago

also please add en docs, I can complete the zh one

svalaskevicius commented 3 months ago

thanks for the review, I'll try to address when I have a chance later!

svalaskevicius commented 3 months ago

hi, I think I've addressed your comments :)

I've based the docs from the search plugin (as the whole plugin :) ), and adapted a bit.

coveralls commented 3 months ago

Pull Request Test Coverage Report for Build 8458428701

Details


Totals Coverage Status
Change from base Build 8446088169: 0.0%
Covered Lines: 697
Relevant Lines: 1253

💛 - Coveralls
svalaskevicius commented 3 months ago

updated again :)

svalaskevicius commented 3 months ago

hi, comments (I think) have been addressed, also upgraded flexsearch to 0.7, please can you review again?

thanks

Mister-Hope commented 3 months ago

It would be great if you can ensure to make new commits instead of rebase and force push. That makes us hard to review.

Here are some suggestions:

  1. Is it possible to only load search index once the search box is focused? The index could be large on huge docs, and I am worried about the entrance chunk size and script exec time.

  2. The search seems to by sync? So on large site will it stuck the ui? If so is it possible to make it a seperate worker?

  3. Are the ui too simple? Could a popup like docsearch be added?

  4. Could we support extra fields? It would be nice if information like tags and categories could be searched.

The original search plugin only index headings, so we do not need to consider these things, however a enhanced seach plugin could achieve these, and even more like search history, better text extracting and others.

An example could be search-pro

svalaskevicius commented 3 months ago

It would be great if you can ensure to make new commits instead of rebase and force push. That makes us hard to review.

Understood

Here are some suggestions:

1. Is it possible to only load search index once the search box is focused? The index could be large on huge docs, and I am worried about the entrance chunk size and script exec time.

2. The search seems to by sync? So on large site will it stuck the ui? If so is it possible to make it a seperate worker?

3. Are the ui too simple? Could a popup like docsearch be added?

4. Could we support extra fields? It would be nice if information like tags and categories could be searched.

The original search plugin only index headings, so we do not need to consider these things, however a enhanced seach plugin could achieve these, and even more like search history, better text extracting and others.

An example could be search-pro

All these are great ideas, however, I don't think I have time enough to implement them :)

All I wanted is to publish the plugin that I had to maintain separately so I don't need to upgrade it manually every time I upgrade vuepress, but for these changes we'd need to find a proper maintainer of the plugin.

As I see the options are:

  1. document your ideas so any volunteer can pick up, and merge the basic functionality as for small websites it's already better than the default one
  2. not merge this PR for a while and keep it open until either a volunteer appears to take it on or it becomes so out of date that it can be closed without losing much
  3. close this PR, without any hard feelings - reason being that the lack of time on my part does not align with minimal expected feature-set on vuepress side :)

Thanks

Mister-Hope commented 3 months ago

Don't worry , I can finish these, but will take time.

I am planning to migrate search-pro plugin to this repo first.

svalaskevicius commented 3 months ago

thank you!

also given this, I'm happy if I'm removed from the author field - given I've only copied and adapted, and you're about to improve it in a serious way :)

all the best! and thanks again for maintaining this project!