-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wildcard query that matches all documents (#234)
* Wildcard query that matches all documents This commit introduces a special wildcard value, `MiniSearch.wildcard`, that matches all documents: ```javascript // Return search results for all documents minisearch.search(MiniSearch.wildcard) // Return search results for all documents in the 'fiction' category minisearch.search(MiniSearch.wildcard, { filter: (result) => result.category === 'fiction' }) ``` This is useful for retrieving all results, but still apply search options such as `filter` and `boostDocument`. It can also be useful in query combinations, for example to query for all documents that DO NOT contain a specific term: ```javascript // Search for all documents that do NOT contain the term "maintenance" const results = ms.search({ combineWith: 'AND_NOT', queries: [ MiniSearch.wildcard, 'maintenance' ] }) ``` * Optimize wildcard search with no document boosting In this case, there is no need to sort the results.
- Loading branch information
Showing
2 changed files
with
103 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters