Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A way to do search #43

Closed
luminarious opened this issue Dec 29, 2016 · 12 comments
Closed

A way to do search #43

luminarious opened this issue Dec 29, 2016 · 12 comments

Comments

@luminarious
Copy link

luminarious commented Dec 29, 2016

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

@QingWei-Li
Copy link
Member

QingWei-Li commented Dec 29, 2016

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.

@egoist
Copy link

egoist commented Dec 30, 2016

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 😂

@yangyang0507
Copy link
Contributor

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

QingWei-Li added a commit that referenced this issue Feb 8, 2017
@QingWei-Li
Copy link
Member

@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/

@BeamerIsHere
Copy link

I have added "<script src="//unpkg.com/docsify/lib/plugins/search.js"></script>"
Search box is appered there but not working. Always giving 'No Result'.
Any suggestion..?

@mrsnax
Copy link

mrsnax commented Jun 10, 2019

I have added "<script src="//unpkg.com/docsify/lib/plugins/search.js"></script>"
Search box is appered there but not working. Always giving 'No Result'.
Any suggestion..?

same here, no results at all :(

@obernardovieira
Copy link

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.

@emthink
Copy link

emthink commented Aug 10, 2019

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)
// ...

@Jayxiang
Copy link

I have added "<script src="//unpkg.com/docsify/lib/plugins/search.js"></script>"
Search box is appered there but not working. Always giving 'No Result'.
Any suggestion..?

same

@ghost
Copy link

ghost commented Mar 5, 2020

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'
        }
      },

@dipunj
Copy link

dipunj commented Dec 4, 2020

I have added "<script src="//unpkg.com/docsify/lib/plugins/search.js"></script>"
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.

@ghost
Copy link

ghost commented Dec 22, 2022

Hi all.

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

I would be happy if docsify has minisearch support.

what is minisearch?

Tiny and powerful JavaScript full-text search engine for browser and Node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants