Skip to content

Search doesn't index #1478

Closed
Closed

Description

@nkavian

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

Activity

  1. sy-records commented on Jan 18, 2021

    @sy-records
    Member

    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

  2. nkavian commented on Jan 18, 2021

    @nkavian
    Author

    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.

  3. sy-records commented on Jan 18, 2021

    @sy-records
    Member

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

  4. Jir4 commented on Feb 4, 2021

    @Jir4

    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.

  5. sy-records commented on Feb 5, 2021

    @sy-records
    Member

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

    @Jir4 Your problem will be fixed in the next version

    image

  6. Jir4 commented on Feb 5, 2021

    @Jir4

    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 ?

  7. added a commit that references this issue on Feb 20, 2021
    0e66834
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions