Fixed #472
This commit is contained in:
@@ -190,7 +190,8 @@ export class SearchEngine {
|
|||||||
}
|
}
|
||||||
const mtime = storedFields?.mtime as number
|
const mtime = storedFields?.mtime as number
|
||||||
const now = new Date().valueOf()
|
const now = new Date().valueOf()
|
||||||
const daysElapsed = (now - mtime) / (24 * 3600)
|
console.log(now)
|
||||||
|
const daysElapsed = (now - mtime) / (24 * 3600_000)
|
||||||
|
|
||||||
// Documents boost
|
// Documents boost
|
||||||
const cutoff = {
|
const cutoff = {
|
||||||
@@ -198,7 +199,9 @@ export class SearchEngine {
|
|||||||
[RecencyCutoff.Week]: -0.3,
|
[RecencyCutoff.Week]: -0.3,
|
||||||
[RecencyCutoff.Month]: -0.1,
|
[RecencyCutoff.Month]: -0.1,
|
||||||
} as const
|
} as const
|
||||||
return 1 + Math.exp(cutoff[settings.recencyBoost] * daysElapsed)
|
return (
|
||||||
|
1 + Math.exp(cutoff[settings.recencyBoost] * (daysElapsed / 1000))
|
||||||
|
)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -331,9 +334,7 @@ export class SearchEngine {
|
|||||||
results.map(async result => {
|
results.map(async result => {
|
||||||
const doc = await this.plugin.documentsRepository.getDocument(result.id)
|
const doc = await this.plugin.documentsRepository.getDocument(result.id)
|
||||||
if (!doc) {
|
if (!doc) {
|
||||||
console.warn(
|
console.warn(`Omnisearch - Note "${result.id}" not in the live cache`)
|
||||||
`Omnisearch - Note "${result.id}" not in the live cache`
|
|
||||||
)
|
|
||||||
countError(true)
|
countError(true)
|
||||||
}
|
}
|
||||||
return doc
|
return doc
|
||||||
|
|||||||
Reference in New Issue
Block a user