Skip to content

Search does not work on the home page #1080

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

Closed
joetidee opened this issue Mar 18, 2020 · 18 comments · Fixed by #1391
Closed

Search does not work on the home page #1080

joetidee opened this issue Mar 18, 2020 · 18 comments · Fixed by #1391
Labels
bug confirmed as a bug

Comments

@joetidee
Copy link

When visiting the home page and typing in a word, the search does not show any results. The search works once in an article page.

@anikethsaha anikethsaha added the bug confirmed as a bug label Mar 18, 2020
@Koooooo-7
Copy link
Member

could u give more details about it.

@joetidee
Copy link
Author

It appears that the search mechanism does not work when on the home page (readme.md) - the type to search placeholder doesn't even show. When on any other page it works.

@sy-records
Copy link
Member

is it that when you visit the home page you can't search for anything else, or is it that you can't search for readme.md's content?

@trusktr
Copy link
Member

trusktr commented Jun 7, 2020

Please let us know how to reproduce. Do you have the code for your site?

@trusktr
Copy link
Member

trusktr commented Jun 10, 2020

In general I think we need to fix up the search feature. It hasn't been completely reliable.

Here's a new WebAssembly-powered search engine for the client side: https://www.infoq.com/news/2020/06/rust-webassembly-fulltext-search/

@anikethsaha
Copy link
Member

Maintaining our own searching plugin + logic can be expensive. I was thinking of this docsearch.algolia.com

@trusktr
Copy link
Member

trusktr commented Jun 10, 2020

Does Algolia work offline?

@trusktr
Copy link
Member

trusktr commented Jun 10, 2020

One of the reasons I chose Docsify was because it came with its own search. An alternative would be to use VuePress which comes with nice Algolia integration (for example).

We can provide an Algolia plugin for that maybe?.

But I really like the idea of having our own (whether its with a lib or with our own code).

@trusktr
Copy link
Member

trusktr commented Jun 10, 2020

The current search features isn't too complex. We just need to add a CLI feature that can save the search info as a local file, then the static site can read this file to get search results. That's the easiest way with shortest amount of code additional to what we have now, I think.

@anikethsaha
Copy link
Member

algolia scraps the site every 24hrs I guess. and I think they do store the content in localstorage.

Yeh, we can offer both plugins ,

@trusktr
Copy link
Member

trusktr commented Jun 13, 2020

I think ombaiz on Discord may be having this issue. Can you check out his link and verify if it looks to be the same issue?

Discord chat: https://discord.com/channels/713647066802421792/713647066802421795/721456182069559397

His website, http://54.37.231.32, seems to only have a home page. The behavior reported is that search is not working. Based on the reported issue here, it would seem that ombaiz is experiencing the same problem (considering he has only a home page, there are no search results).

@anikethsaha
Copy link
Member

I can confirm search is not working in homepage even in our docs site

@ixdarchitects
Copy link

May I suggest docsify team have a high level review of the search feature.

The search should be flexible enough to be place at different pages/levels:

  • In the global _coverpage.md (or a custom coverpage.html) to search all content in the site
  • If there are multiple folders/projects hosted in the /docs folder, we should be able to configure the search in the sidebar to only search content in the particular folder/project

@markbattistella
Copy link
Contributor

I've got private facing docs site with this issue too - but our home page only is the _coverpage. Clicking "View Documentation" to jump to item 1 in the TOC the search doesn't show. A hard refresh shows it, but only then. I've tested the order of the scripts loading, but hasn't changed anything

@sy-records
Copy link
Member

sy-records commented Oct 12, 2020

@markbattistella In docsify.js.org, I can't reproduce the problem you're talking about.

@markbattistella
Copy link
Contributor

@sy-records I made this repo: https://github.com/markbattistella/docsify-searchTest to show how I have it set up and the search doesn't auto load. I tried getting it working gh-pages but i couldn't get it working in the small amount of time :)

@sy-records
Copy link
Member

@markbattistella Your problem is caused by your docsify-autoheaders plugin, Just remove the scope.

autoHeaders: {
    separator: 'decimal',
    levels: '3',
},

@joetidee
Copy link
Author

Am I right in saying that the Search plugin only indexes links on pages you have already visited? In which case, it's a bit of a useless feature.

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

Successfully merging a pull request may close this issue.

7 participants