Removed useless minisearch storeFields

This commit is contained in:
Simon Cambier
2022-04-10 12:54:42 +02:00
parent 11b9940cc7
commit cf5f4be43f

View File

@@ -55,7 +55,6 @@ export default class OmnisearchPlugin extends Plugin {
this.minisearch = new MiniSearch<OmniNote>({ this.minisearch = new MiniSearch<OmniNote>({
idField: 'path', idField: 'path',
fields: ['body', 'title', 'name'], fields: ['body', 'title', 'name'],
storeFields: ['body', 'title', 'name'],
}) })
} }
@@ -196,10 +195,11 @@ class OmnisearchModal extends SuggestModal<OmniNote> {
console.log(results) console.log(results)
return results.map(result => { return results.map(result => {
const note = this.plugin.notes[result.id]
// result.id == the file's path // result.id == the file's path
let name = result.name let name = note.name
let title = result.title let title = note.title
let body = result.body let body = note.body
// If the body contains a searched term, find its position // If the body contains a searched term, find its position
// and trim the text around it // and trim the text around it