Skip to content

Non-English search support #2393

Open
Open
@Sunshine40

Description

@Sunshine40

#1081 has been stuck for a while, so I tried implementing my own version.

Preview the search functionality online

Inspired by #1496.

Major implementation steps:

  • Land Add non-English search support #2392
    • Fix buggy teaser (preview) 1
      • Keyword highlighting doesn't work as expected for Chinese
      • The selected range displayed as teaser sometimes contains no keywords at all (the target chapter does contain the keyword though)
    • Enhance mixed multi language search support
      • Implement a "fallback" strategy for text in mixed languages (detail)
  • Support Emoji search
  • Localize UI rendered by HTML renderer

Unresolved questions:

  • Should search-non-english feature be enabled by default? (Not likely, since it causes severe binary size bloat)
    • Should each supported language have an individual feature flag? Would it make the feature flag list too noisy?
  • Should we consider other search solutions than elasticlunr.js & lunr-languages?
  • Should the new "fallback" search implementation apply to English books as well?

Footnotes

  1. image

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: Enhancement or feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions