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 Plugin - Some terms dont give results #1876

Closed
LuGr-01 opened this issue Sep 5, 2022 · 2 comments · Fixed by #1878
Closed

Search Plugin - Some terms dont give results #1876

LuGr-01 opened this issue Sep 5, 2022 · 2 comments · Fixed by #1878
Labels
bug confirmed as a bug

Comments

@LuGr-01
Copy link

LuGr-01 commented Sep 5, 2022

I do not know if its my own fault or if this is a bug... 🧐

I'm using the docsify (v4.12.2) search plugin. Some search terms don't deliver a result, not even a "No results!" is returned. When typing in the search field the Error "Uncaught TypeError: c is undefined" is logged in the web console for each typed character of the browser.

grafik

With other patterns a "No results!" is indeed returned. It would even be enough to add a character after the above used word to return a result.

188431823-1c07b9c4-3e1c-4d96-888b-adaeacfef9a5
grafik

And other words give the expected results.

188431663-ddfb6510-6f6a-451a-a2f5-6b4db1ec8e42

My index.html

<!DOCTYPE html>
<html lang="en">
 <head>
    <meta charset="UTF-8" />
    <title>Document</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="description" content="Description" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0" />

    <link rel="stylesheet" href="node_modules/docsify-themeable/dist/css/theme-defaults.css" />
 </head>
 <body>
    <div id="app"></div>
    <script>
       var lang = location.hash.match(/#\/(de|en)\//);

       if (lang) {
          document.documentElement.setAttribute('lang', lang[1]);
       }

       window.$docsify = {
          auto2top: true,
          themeColor: '#be1a47',
          name: 'Mandy Docs',
          repo: '',
          loadSidebar: true,
          loadNavbar: true,
          mergeNavbar: true,
          maxLevel: 5,
          subMaxLevel: 3,
          alias: {
             '/de/(.*)': '/de/$1',
             '/en/(.*)': '/en/$1',
             '/(.*)': '/en/$1',
          },
          search: {
             paths: 'auto',
             noData: {
                '/de/': 'Keine Ergebnisse!',
                '/en/': 'No results!',
                '/': 'No results!',
             },
             placeholder: {
                '/de/': 'Suche',
                '/en/': 'Search',
                '/': 'Search',
             },

             hideOtherSidebarContent: true,
             pathNamespaces: ['/en', '/de'],
          },
          nameLink: {
             '/en/': '#/en/',
             '/de/': '#/de/',
             '/': '#/en/',
          },
       };
    </script>
    <script src="node_modules/docsify/lib/docsify.min.js"></script>
    <script src="node_modules/docsify/lib/plugins/search.min.js"></script>
    <script src="node_modules/docsify/lib/plugins/emoji.min.js"></script>

    <script src="node_modules/docsify-copy-code/dist/docsify-copy-code.min.js"></script>
    <script src="node_modules/docsify-pagination/dist/docsify-pagination.min.js"></script>

    <script src="node_modules/docsify-themeable/dist/js/docsify-themeable.min.js"></script>
 </body>
</html>

My folder structure looks like:

📦docs
┣ 📂de
┃ ┣ 📂folder
┃ ┃ ┣ 📜file.md
┃ ┃ ┣ 📜file.md
┃ ┣ 📂folder
┃ ┃ ┣ 📜file.md
┃ ┃ ┣ 📜file.md
┃ ┣ 📜CHANGELOG.md
┃ ┣ 📜README.md
┃ ┣ 📜_navbar.md
┃ ┗ 📜_sidebar.md
┣ 📂en
┃ ┣ 📂folder
┃ ┃ ┣ 📜file.md
┃ ┃ ┣ 📜file.md
┃ ┣ 📂folder
┃ ┃ ┣ 📜file.md
┃ ┃ ┣ 📜file.md
┃ ┣ 📜CHANGELOG.md
┃ ┣ 📜README.md
┃ ┣ 📜_navbar.md
┃ ┗ 📜_sidebar.md
┣ 📂node_modules
┣ ...
┣ 📜favicon.ico
┣ 📜index.html
┣ 📜package-lock.json
┗ 📜package.json

Example Repo here:

https://github.com/LuGrInaut/docsify-search-not-working

Open in StackBlitz

I already searched the GitHub Issues for topics regarding the search topic but I'm not sure if this has something to do with the Indexes in the Local Browser Storage or with something else.

Thanks,
Lukas

@Koooooo-7
Copy link
Member

Hi Lukas, I can not reproduce it when I do a search with biofilter . could you plz provide a lite sample/repo about it ?

@LuGr-01
Copy link
Author

LuGr-01 commented Sep 12, 2022

Hello @Koooooo-7,

Here you go:

https://github.com/LuGrInaut/docsify-search-not-working

Open in StackBlitz

@Koooooo-7 Koooooo-7 added the bug confirmed as a bug label Sep 12, 2022
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.

2 participants