This pull request introduces a special wildcard value, MiniSearch.wildcard, that matches all documents:
// 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:
// Search for all documents that do NOT contain the term "maintenance"
const results = ms.search({
combineWith: 'AND_NOT',
queries: [
MiniSearch.wildcard,
'maintenance'
]
})
This pull request introduces a special wildcard value,
MiniSearch.wildcard
, that matches all documents:This is useful for retrieving all results, but still apply search options such as
filter
andboostDocument
. It can also be useful in query combinations, for example to query for all documents that DO NOT contain a specific term: