vsm-dictionary-cacher
Advanced tools
Comparing version 1.0.7 to 1.0.8
{ | ||
"name": "vsm-dictionary-cacher", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "Wrapper around a VSM-dictionary, that manages a cache of string-match results", | ||
@@ -5,0 +5,0 @@ "main": "src/VsmDictionaryCacher.js", |
@@ -45,3 +45,3 @@ # vsm-dictionary-cacher | ||
Install like: | ||
Install like (after also installing a `vsm-dictionary-...` of choice) : | ||
``` | ||
@@ -62,6 +62,6 @@ npm install vsm-dictionary-cacher --save-prod | ||
// This will query the Dictionary as normal, bypassing the cache. | ||
dict.getMatchesForString('abc', {filter: {dictID: 'Foo'}}, (err, res) => { | ||
dict.getMatchesForString('abc', {filter: {dictID: ['Foo']}}, (err, res) => { | ||
// This will get the result from the cache (instead of re-running the query). | ||
dict.getMatchesForString('abc', {filter: {dictID: 'Foo'}}, (err, res) => { | ||
dict.getMatchesForString('abc', {filter: {dictID: ['Foo']}}, (err, res) => { | ||
@@ -71,4 +71,4 @@ }); | ||
// These will *not* get their result from the cache. | ||
dict.getMatchesForString('abc', {filter: {dictID: 'BAR'}}, (err, res) => {}); | ||
dict.getMatchesForString('QQQ', {filter: {dictID: 'Foo'}}, (err, res) => {}); | ||
dict.getMatchesForString('abc', {filter: {dictID: ['BAR']}}, (err, res) => {}); | ||
dict.getMatchesForString('QQQ', {filter: {dictID: ['Foo']}}, (err, res) => {}); | ||
@@ -104,5 +104,15 @@ }); | ||
Default is `true`. | ||
- For that collection of strings, `maxItems` and `maxAge` do not apply. | ||
- Note: For that collection of strings, `maxItems` and `maxAge` do not apply. | ||
But the collection gets cleared whenever the main cache gets cleared (so | ||
also after a long time of no access (see below under 'Memory management')). | ||
- Note: a query for matching refTerms (to `getRefTerms()`) | ||
will still be made, | ||
because e.g. after a call for "i" would give no results (and "i" ends up | ||
in cacheEmpties), a subsequent call for the refTerm "it" should still | ||
return it as a result. | ||
(Note that a refTerm is only returned as an exact string match). | ||
- Note: a call to `getMatchesForString()` is also still made, | ||
because e.g. after a call for "1e" gave no results, | ||
a subsequent call for the valid number-string "1e5" | ||
should still return it as a result. | ||
@@ -109,0 +119,0 @@ Specify options like: |
@@ -0,0 +0,0 @@ const cacher = require('./VsmDictionaryCacher'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38101
169