minisearch
Advanced tools
Comparing version 6.0.1 to 6.1.0
@@ -5,2 +5,10 @@ # Changelog | ||
# v6.1.0 | ||
- Add `getStoredFields` method to retrieve the stored fields for a document | ||
given its ID. | ||
- Pass stored fields to the `boostDocument` callback function, making it | ||
easier to perform dynamic document boosting. | ||
# v6.0.1 | ||
@@ -7,0 +15,0 @@ |
@@ -15,3 +15,5 @@ /****************************************************************************** | ||
***************************************************************************** */ | ||
/* global Reflect, Promise */ | ||
function __values(o) { | ||
@@ -18,0 +20,0 @@ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; |
@@ -15,3 +15,5 @@ /****************************************************************************** | ||
***************************************************************************** */ | ||
/* global Reflect, Promise */ | ||
function __values(o) { | ||
@@ -18,0 +20,0 @@ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; |
@@ -286,5 +286,8 @@ type LeafType = '' & { | ||
* the document ID, and a term that matches the search in that document, and | ||
* should return a boosting factor. | ||
* the value of the stored fields for the document (if any). It should return | ||
* a boosting factor: a number higher than 1 increases the computed score, a | ||
* number lower than 1 decreases the score, and a falsy value skips the search | ||
* result completely. | ||
*/ | ||
boostDocument?: (documentId: any, term: string) => number; | ||
boostDocument?: (documentId: any, term: string, storedFields?: Record<string, unknown>) => number; | ||
/** | ||
@@ -916,2 +919,10 @@ * Controls whether to perform prefix search. It can be a simple boolean, or a | ||
/** | ||
* Returns the stored fields (as configured in [[Options.storeFields]]) for | ||
* the given document ID. Returns `undefined` if the document is not present | ||
* in the index. | ||
* | ||
* @param id The document ID | ||
*/ | ||
getStoredFields(id: any): Record<string, unknown> | undefined; | ||
/** | ||
* Search for documents matching the given search query. | ||
@@ -918,0 +929,0 @@ * |
@@ -21,3 +21,5 @@ (function (global, factory) { | ||
***************************************************************************** */ | ||
/* global Reflect, Promise */ | ||
function __values(o) { | ||
@@ -24,0 +26,0 @@ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; |
{ | ||
"name": "minisearch", | ||
"version": "6.0.1", | ||
"version": "6.1.0", | ||
"description": "Tiny but powerful full-text search engine for browser and Node", | ||
@@ -5,0 +5,0 @@ "main": "dist/umd/index.js", |
@@ -88,3 +88,3 @@ # MiniSearch | ||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/minisearch@6.0.1/dist/umd/index.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/minisearch@6.1.0/dist/umd/index.min.js"></script> | ||
``` | ||
@@ -91,0 +91,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
1237353
18134