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

Search doesn't index #1478

Closed
1 task done
nkavian opened this issue Jan 17, 2021 · 8 comments · Fixed by #1519
Closed
1 task done

Search doesn't index #1478

nkavian opened this issue Jan 17, 2021 · 8 comments · Fixed by #1519
Labels

Comments

@nkavian
Copy link

nkavian commented Jan 17, 2021

Bug Report

Steps to reproduce

Create three MD files, enable the sidebar, enable search, and observe that search doesn't work.

https://codesandbox.io/s/fervent-almeida-1p5us?file=/index.html

What is current behaviour

docsify.search.index only contains content for a.md and b.md/c.md was not parsed into the index:

{
"/a":{"#/a?id=hn2":{"slug":"#/a?id=hn2","title":"HN2","body":"HN3\nHello A"}},
"/b":{},
"/c":{}
}

Using Chrome incognito is even worse, not even a.md is searchable.

What is the expected behaviour

The index should properly contain all pages to be able to perform a search.

Other relevant information

  • Bug does still occur when all/other plugins are disabled?

  • Your OS: Mac / Chrome

  • Docsify version: latest

  • Docsify plugins: search.min.js

Please create a reproducible sandbox

https://codesandbox.io/s/fervent-almeida-1p5us?file=/index.html

Mention the docsify version in which this bug was not present (if any)

N/A

@sy-records
Copy link
Member

sy-records commented Jan 18, 2021

You need to add a title. see https://codesandbox.io/s/modest-pike-ehdh9

## Hello B

```java
public interface Foo { }

It is also normal to use incognito mode in chrome

@nkavian
Copy link
Author

nkavian commented Jan 18, 2021

That does work around the issue sometimes, but not all the time. I won't be able to use autoHeader.

For example, if I want my page to look like this (search works, but then I can't use autoHeader):

# Page Title

This is some description. A long paragraph.

If I use autoHeader, then my page would start like this (search doesn't work):

This is some description. We assume autoHeader added the # Title. A long paragraph.

So compatibility with autoHeader is an issue. Overall however, there should not be a dependency between a page/section title versus the search indexing. All page content should be able to be indexed. Can you consider this a bug and fix it? This will be very counter intuitive for other people and they won't know that search isn't truly working for all of their content.

@sy-records
Copy link
Member

Thank you for your feedback, I will check it as soon as possible

@Jir4
Copy link

Jir4 commented Feb 4, 2021

It's still not possible to find something in a list : https://codesandbox.io/s/sparkling-cdn-v87gl

For example you can search "object" on your sandbox and on mine.

@sy-records
Copy link
Member

https://codesandbox.io/s/modern-wind-hm6wn

@Jir4 Your problem will be fixed in the next version

image

@ghost
Copy link

ghost commented Feb 5, 2021

怎么设置,都搜不到README.md以外的内容

@Jir4
Copy link

Jir4 commented Feb 5, 2021

https://codesandbox.io/s/modern-wind-hm6wn

@Jir4 Your problem will be fixed in the next version

image

#1361 i guess

Didn't search enough sorry.

Any release date planned ?

@ghost
Copy link

ghost commented Feb 20, 2021

search still not work

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

Successfully merging a pull request may close this issue.

3 participants