From a0e7ba3666269c2a991b8688ad12b29c61737e73 Mon Sep 17 00:00:00 2001 From: jlukic Date: Mon, 6 Apr 2015 18:53:45 -0400 Subject: [PATCH] #2065 add clear cache to search --- src/definitions/modules/search.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/definitions/modules/search.js b/src/definitions/modules/search.js index 1326d6247..1291942d2 100644 --- a/src/definitions/modules/search.js +++ b/src/definitions/modules/search.js @@ -544,6 +544,20 @@ $.fn.search = function(parameters) { } }, + clear: { + cache: function(value) { + if(!value) { + module.debug('Clearing cache', value); + $module.removeData(metadata.cache); + } + else if(value && cache && cache[value]) { + module.debug('Removing value from cache', value); + delete cache[value]; + $module.data(metadata.cache, cache); + } + } + }, + read: { cache: function(name) { var