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

Content under initial # in a docs page is not found #109

Closed
andrewsnowden opened this issue Sep 3, 2021 · 2 comments
Closed

Content under initial # in a docs page is not found #109

andrewsnowden opened this issue Sep 3, 2021 · 2 comments

Comments

@andrewsnowden
Copy link

In a markdown page, if I add content directly underneath the top level heading then it does not appear in the search results. For example, if I have a markdown page like:

# My title

Search below title

## Subtitle

Search below subtitle

I then search for the word "search" and it will only show me one result which is the "Search below subtitle" line.

I verified this with a brand new blank Docusaurus install, adding the search plugin and putting some content directly under a title. I can attach the example project if that will be helpful.

Thanks for the great project!

@Lytsu
Copy link

Lytsu commented Dec 24, 2021

It may be that your markdown document is recognized as Pages instead of Documents, try adding indexPages:true to the plugin options.

plugins: [
            '@easyops-cn/docusaurus-search-local',
            {
              // `hashed` is recommended as long-term-cache of index file is possible.
              hashed: true,
              // For Docs using Chinese, The `language` is recommended to set to:
              language: ["en", "zh"],
              // When applying `zh` in language, please install `nodejieba` in your project
              highlightSearchTermsOnTargetPage: false,
              indexDocs:true,
              indexPages:true,
            },
]

Cyriuz added a commit to Cyriuz/docusaurus-search-local that referenced this issue May 11, 2022
Cyriuz added a commit to Cyriuz/docusaurus-search-local that referenced this issue May 18, 2022
weareoutman added a commit that referenced this issue May 19, 2022
@weareoutman
Copy link
Member

I think this is fixed by recent updates. Please try latest @easyops-cn/docusaurus-search-local with latest docusaurus.

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

No branches or pull requests

3 participants