From 88ba7efe57e04f4ac08192d35ebc10bb40261d2c Mon Sep 17 00:00:00 2001 From: ULIVZ Date: Mon, 7 Nov 2022 19:53:17 +0800 Subject: [PATCH] fix(theme): full text search doesn't support partial search (close: #77) (#78) Using [reverse](https://github.com/nextapps-de/flexsearch#tokenizer-prefix-search) tokenizer, support incrementally index words in both directions --- .../plugins/fulltext-search/services/flexsearchSvc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vuepress-theme-vt/plugins/fulltext-search/services/flexsearchSvc.js b/packages/vuepress-theme-vt/plugins/fulltext-search/services/flexsearchSvc.js index 76197e8..fc756be 100644 --- a/packages/vuepress-theme-vt/plugins/fulltext-search/services/flexsearchSvc.js +++ b/packages/vuepress-theme-vt/plugins/fulltext-search/services/flexsearchSvc.js @@ -19,7 +19,7 @@ export default { ); const indexSettings = { encode: options.encode || "simple", - tokenize: options.tokenize || "forward", + tokenize: options.tokenize || "reverse", split: options.split || /\W+/, async: true, doc: {