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 in Japanese doesn't work #3112

Closed
5 tasks done
waka4g opened this issue Oct 17, 2021 · 2 comments
Closed
5 tasks done

search in Japanese doesn't work #3112

waka4g opened this issue Oct 17, 2021 · 2 comments
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open

Comments

@waka4g
Copy link

waka4g commented Oct 17, 2021

Contribution guidelines

I've found a bug and checked that ...

  • ... the problem doesn't occur with the mkdocs or readthedocs themes
  • ... the problem persists when all overrides are removed, i.e. custom_dir, extra_javascript and extra_css
  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem

Description

Search in Japanese doesn't work. When I type characters in search box, error message "invalid query" displays in browser console.

Expected behaviour

Search in Japanese works propery as well as other language as attached (theme language "en").
2021-10-17_22h37_15

Actual behaviour

When I type characters in search box, error message "invalid query" displays in browser console, and nothing found.
2021-10-17_22h40_30

Steps to reproduce

  1. Install mkdocs-material.
  2. mkdocs serve

Package versions

  • Python: 3.8.12
  • MkDocs: version 1.2.3
  • Material: Version: 7.3.3

Configuration

site_name: My Docs
theme:
  name: material
  language: ja

nav:
  - Home: index.md

plugins:
  - search:
      lang: ja

System information

  • Operating system: Windows 10
  • Browser: Chrome 94.0.4606.8
@squidfunk squidfunk added the bug Issue reports a bug label Oct 17, 2021
@squidfunk
Copy link
Owner

Thanks for reporting. Fixed in 7725e555f.

The problem stems from the incompatibility of the tokenizer provided by lunr-languages and the new tokenizer of Material for MkDocs. I think I managed to workaround the issue for now, moving the segmenting process into the tokenizer, but this definitely needs some work. I'll revisit the integration of the segmenting process into the pipeline at a later time. The search now seems to work quite well I think.

@squidfunk squidfunk added the resolved Issue is resolved, yet unreleased if open label Oct 17, 2021
@squidfunk
Copy link
Owner

Released as part of 7.3.4+insiders-3.1.4 – if the issue persists, please reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open
Projects
None yet
Development

No branches or pull requests

2 participants