Vuepress: Self hosted search

Created on 4 Sep 2018  路  6Comments  路  Source: vuejs/vuepress


Feature request

According to https://vuepress.vuejs.org/default-theme-config/#search-box there are only two ways of searching one is the built-in one but does not have a full text search and another is Algolia which is hosted.

I am looking for a self hosted one. Free ideally.



What problem does this feature solve?

$$$ for private documents.

What does the proposed API look like?

I am thinking along the lines of using either ElasticSearch or MongoDB (probably MongoDB) because it is smaller and fits into Docker ecosystem easier. Which will provide some sort of indexer.

Perhaps something like the following in the CLI

vuepress index --format=mongodb

Which will generate a file that is suitable executing in the MongoDB CLI which can be used to generate JS files that do database inserts that would be suitable for the MongoDB Docker image

How should this be implemented in your opinion?

The easy part would likely be to write the mongo JS insert statements.

The hard parts would be:

a) modifying the default template to allow that as a new search using mongo-rest API. mongo-rest would be used to wrap Mongo in a readonly mode so we do not need to deal with administration
b) figuring out what to store into the mongodb.

Are you willing to work on this yourself?**

No.

feature request next

Most helpful comment

Lunr (https://lunrjs.com/) is a good option, provided you can make a json file with your contents as input. It works for me on some static Japanese sites I build (not on vuepress), and I have heard others say it's fine with the other "CJK" languages.

All 6 comments

Cool, I think it's a useful feature, we'll plan to do more for that at next branch.

Was this Feature Included in VuePress?

Expect to next version

So if I use the "Develop Version" (installing from this Repo) I can use this Feature?

Lunr (https://lunrjs.com/) is a good option, provided you can make a json file with your contents as input. It works for me on some static Japanese sites I build (not on vuepress), and I have heard others say it's fine with the other "CJK" languages.

For now VuePress doesn't plan to support dynamic data source in the core, but you can implement it by writing a plugin.

FYI, you can just fork @vuepress/plugin-search.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

herrbischoff picture herrbischoff  路  3Comments

genedronek picture genedronek  路  3Comments

shaodahong picture shaodahong  路  3Comments

FadySamirSadek picture FadySamirSadek  路  3Comments

zeke picture zeke  路  3Comments