-1

I use Markdown. There is a plugin called search. In this plugin, the search for words in Russian does not work, but the search for English words works. How can I make the search for English and Russian words work in this plugin?

Cuurjol
  • 1
  • 1
  • 3
  • Which plugin and what program is it a plugin for? – Waylan Jul 12 '18 at 12:44
  • https://www.mkdocs.org/user-guide/plugins/#using-plugins — documentation. There is an example of how to add a plugin. I use a standard search plugin, but it only looks for English words. – Cuurjol Jul 12 '18 at 12:59

1 Answers1

1

MkDocs version 0.17 and earlier only support English for search. MkDocs relies on the lunr.js for search, and by itself, lunr.js only supports English. Therefore, it is currently not possible to support other languages.

However, the search plugin for MkDocs was recently refactored to use Lunr Languages (among other changes) and that change will be available in MkDocs version 1.0, which is expected to be released in the next few weeks (I am a member of the development team for MkDocs). A preview of the documentation for the new features can be found here and is copied below for future reference.

As a reminder, the documentation below only applies to MkDocs version 1.0, which has not yet been released.

Search

A search plugin is provided by default with MkDocs which uses lunr.js as a search engine. The following config options are available to alter the behavior of the search plugin:

...

lang

A list of languages to use when building the search index as identified by their ISO 639-1 language codes. With Lunr Languages, the following languages are supported:

  • da: Danish
  • du: Dutch
  • en: English
  • fi: Finnish
  • fr: French
  • de: German
  • hu: Hungarian
  • it: Italian
  • jp: Japanese
  • no: Norwegian
  • pt: Portuguese
  • ro: Romanian
  • ru: Russian
  • es: Spanish
  • sv: Swedish
  • th: Thai
  • tr: Turkish

You may contribute additional languages.

Warning:

While search does support using multiple languages together, it is best not
to add additional languages unless you really need them. Each additional
language adds significant bandwidth requirements and uses more browser
resources. Generally it is best to keep each instance of MkDocs to a single
language.

Note:

Lunr Languages does not currently include support for Chinese or other Asian
languages. However, some users have reported decent results using Japanese.

default: ['en']

Waylan
  • 37,164
  • 12
  • 83
  • 109