FlexSearch

Search your Doks site with FlexSearch. Easily customize index settings and search options to your liking.

On this page

FlexSearch Doks

Language settings

Insert after line 82 in ./assets/js/index.js the language specific settings, like so:

  1. ..
  2. var index = new FlexSearch({
  3. preset: 'score',
  4. cache: true,
  5. doc: {
  6. id: 'id',
  7. field: [
  8. 'title',
  9. 'description',
  10. 'content',
  11. ],
  12. store: [
  13. 'href',
  14. 'title',
  15. 'description',
  16. ],
  17. },
  18. // Insert language specific settings below — e.g. Latin
  19. encode: "simple",
  20. tokenize: "forward"
  21. });
  22. ..

Latin

  1. ..
  2. encode: "simple",
  3. tokenize: "forward"
  4. ..

Arabic

  1. ..
  2. encode: false,
  3. rtl: true,
  4. split: /\s+/,
  5. tokenize: "forward"
  6. ..

Cyrilic, Indian

Any word separated by space language:

  1. ..
  2. encode: false,
  3. split: /\s+/,
  4. tokenize: "forward"
  5. ..

Chinese, Japanese or Korean

With dedicated chars w/o spaces:

  1. ..
  2. encode: false,
  3. tokenize: function(str){
  4. return str.replace(/[\x00-\x7F]/g, "").split("");
  5. }
  6. ..

Source