fix a couple issues with the search that caused a load failure with the new file list change

This commit is contained in:
Alexandra
2024-10-18 02:20:41 -06:00
committed by GitHub
parent ac30fc0300
commit 4915297f01

View File

@@ -9,11 +9,7 @@ export default class Searcher{
findAllMatches(query){
var startTime = process.hrtime();
let results = this.miniSearch.search(query, {
filter: (result) => {
return result.score >= this.minMatch
}
})
let results = this.miniSearch.search(query)
var elapsed = this.parseHrtimeToSeconds(process.hrtime(startTime));
return {
items: results,
@@ -23,7 +19,7 @@ export default class Searcher{
createIndex(fileArr){
this.miniSearch = new MiniSearch({
fields: ['name', 'category', 'type'],
fields: ['filename', 'category', 'type'],
storeFields: ['filename', 'category', 'type', 'date', 'size', 'region', 'path'],
searchOptions: {
boost: { name: 2 },