From 952b92a80b767534009c47d4afa2f23130c93cdd Mon Sep 17 00:00:00 2001 From: Thomas Wilkerling Date: Sun, 13 Apr 2025 15:44:20 +0200 Subject: [PATCH] fix document.searchCache() --- README.md | 5 +- demo/autocomplete.html | 128 ++++++--- dist/flexsearch.bundle.debug.js | 24 +- dist/flexsearch.bundle.min.js | 4 +- dist/flexsearch.bundle.module.debug.js | 24 +- dist/flexsearch.bundle.module.min.js | 4 +- dist/flexsearch.compact.debug.js | 24 +- dist/flexsearch.compact.min.js | 4 +- dist/flexsearch.compact.module.debug.js | 24 +- dist/flexsearch.compact.module.min.js | 4 +- dist/flexsearch.es5.debug.js | 24 +- dist/flexsearch.es5.min.js | 4 +- dist/flexsearch.light.debug.js | 2 +- dist/flexsearch.light.min.js | 2 +- dist/flexsearch.light.module.debug.js | 2 +- dist/flexsearch.light.module.min.js | 2 +- dist/module-debug/cache.js | 17 +- dist/module-min/cache.js | 2 +- dist/module/cache.js | 17 +- doc/context-index.svg | 131 +++++++++ doc/contextual-index.svg | 339 ------------------------ package-lock.json | 4 +- package.json | 2 +- src/cache.js | 29 +- test/basic.js | 81 ++++-- test/cache.js | 27 +- test/encoder.js | 12 + 27 files changed, 419 insertions(+), 523 deletions(-) create mode 100644 doc/context-index.svg delete mode 100644 doc/contextual-index.svg diff --git a/README.md b/README.md index 804da36..3915817 100644 --- a/README.md +++ b/README.md @@ -1537,13 +1537,12 @@ index.cleanup(); > The `cleanup` method has no effect when not using `fastupdate: true`. - ## Context Search The basic idea of this concept is to limit relevance by its context instead of calculating relevance through the whole distance of its corresponding document. The context acts like a bidirectional moving window of 2 pointers (terms) which can initially have a maximum distance of the value passed via option setting `depth` and dynamically growth on search when the query did not match any results.

- +

### Enable Context-Search @@ -1574,7 +1573,7 @@ var index = new FlexSearch({ ### Compare Context Search -Pay attention of the numbers "1", "2" and "3": +Pay attention to the numbers "1", "2" and "3": ```js const index = new Index(); diff --git a/demo/autocomplete.html b/demo/autocomplete.html index c9ebcf7..66ee1a3 100644 --- a/demo/autocomplete.html +++ b/demo/autocomplete.html @@ -1,29 +1,31 @@ - - + + Demo: Auto-Complete -(iterate through result by arrow keys) - - - - -
- - -
+
+