Fuse Engine

Summary

Lifecycle

init

constructor { 
    createFuse { 

    }

}

queryNote

  • queries fuse
if qs = "" {
		items = @index.search "root"
} else if qs = "*" {
		items = @index._docs
} else {
		formattedQS = formatQueryForFuse(qs)
		results = @notesIndex.search formattedQS
		postQueryFilter(results)
		results = sortResults
		items := results
}
return items
sortResults(results, originalQS) {
    groupedByScore = groupBy(results)
    ...


    sorted := groupedByScore

    if originalQS {
        sorted = moveOriginalQSFirst(sorted, originalQS)
    }
    return sorted
}

Dependencies

  • fuse.js: "^6.4.6" as of 2022-06-03

Backlinks