| 1869 | | 1869 | |
| 1870 | // Check cache for existing results | 1870 | // Check cache for existing results |
| 1871 | if (cache.keyHash === currentKeyHash && cache.resultMap.has(searchValue)) { | 1871 | if (cache.keyHash === currentKeyHash && cache.resultMap.has(searchValue)) { |
| 1872 | console.log(`Using cached ${type} fuzzy search results for ${searchValue}`); | 1872 | // console.debug(`Using cached ${type} fuzzy search results for ${searchValue}`); |
| 1873 | return cache.resultMap.get(searchValue); | 1873 | return cache.resultMap.get(searchValue); |
| 1874 | } | 1874 | } |
| 1875 | | 1875 | |
| 1876 | // Clear cache if keys changed | 1876 | // Clear cache if keys changed |
| 1877 | if (cache.keyHash !== currentKeyHash) { | 1877 | if (cache.keyHash !== currentKeyHash) { |
| 1878 | console.log(`${type} Fuse keys changed, clearing cache`); | 1878 | // console.debug(`${type} Fuse keys changed, clearing cache`); |
| 1879 | cache.keyHash = currentKeyHash; | 1879 | cache.keyHash = currentKeyHash; |
| 1880 | cache.resultMap.clear(); | 1880 | cache.resultMap.clear(); |
| 1881 | } | 1881 | } |