Docsify: A way to do search

Created on 29 Dec 2016  Â·  11Comments  Â·  Source: docsifyjs/docsify

Needs a way to do search in sidebar, like Docute. One options is something like http://lunrjs.com

help wanted

Most helpful comment

@luminarious @egoist @yangyang0507
The search is supported! Because I consider to be compatible with Chinese characters, I did not use lunrjs.

<script src="//unpkg.com/docsify/lib/docsify.js"></script>
<script src="//unpkg.com/docsify/lib/plugins/search.js"></script>

demo: https://docsify.js.org/

All 11 comments

Actually, I considered doing search. I like docute implementation, but i dont think it is easy to use.

I have considered using GitHub search API, that we can easy doing seach, such as. But it has rate limit.

For unauthenticated requests, the rate limit allows you to make up to 10 requests per minute.

Lunrjs looks good, but seems to only search the current page?

I have no other ideas.

For large website, I think it's worth putting effort to use docsearch from algolia, since it's really powerful.

For small-to-medium website, maybe a feature like gitbook's search? but it requires to build json

For small website, we may not need to search (๑˙ー˙๑)


And, what about private docs 😂

How about hexo-theme-next's localSearch, use hexo-generator-search, it will generate a json file(db.json) to save searchinfo. but this plugin base on hexo

@luminarious @egoist @yangyang0507
The search is supported! Because I consider to be compatible with Chinese characters, I did not use lunrjs.

<script src="//unpkg.com/docsify/lib/docsify.js"></script>
<script src="//unpkg.com/docsify/lib/plugins/search.js"></script>

demo: https://docsify.js.org/

I have added ""
Search box is appered there but not working. Always giving 'No Result'.
Any suggestion..?

I have added ""
Search box is appered there but not working. Always giving 'No Result'.
Any suggestion..?

same here, no results at all :(

Within <body> there's a <script src="//unpkg.com/docsify/lib/docsify.min.js"></script>, add <script src="//unpkg.com/docsify/lib/plugins/search.js"></script> after that. It worked for me.

The search plugin is searching nested with nested sidebar, so must set:

window.$dcosify = {
  loadSidebar: true
};

And in default _sidebar.md, we need add the nested file:

* [Configuration](configuration/)
  * [Basic Configuration](configuration/basic)
// ...

I have added ""
Search box is appered there but not working. Always giving 'No Result'.
Any suggestion..?

same

Following the configuration of https://docsify.js.org/, my project search function works fine.

    search: {
        noData: {
          '/zh-cmn/': '没有结果!',
          '/en/': 'No results!'
        },
        paths: 'auto',
        placeholder: {
          '/zh-cmn/': 'Search',
          '/en/': 'Search'
        }
      },

I have added ""
Search box is appered there but not working. Always giving 'No Result'.
Any suggestion..?

It builds a search index in your localstorage, which might take a while to create.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lukasmrtvy picture lukasmrtvy  Â·  5Comments

nothingrandom picture nothingrandom  Â·  5Comments

jhildenbiddle picture jhildenbiddle  Â·  3Comments

SidVal picture SidVal  Â·  3Comments

sy-records picture sy-records  Â·  4Comments