Always remove diacritics
This commit is contained in:
@@ -331,9 +331,7 @@ export class SearchEngine {
|
||||
results.map(async result => {
|
||||
const doc = await this.plugin.documentsRepository.getDocument(result.id)
|
||||
if (!doc) {
|
||||
console.warn(
|
||||
`Locator - Note "${result.id}" not in the live cache`
|
||||
)
|
||||
console.warn(`Locator - Note "${result.id}" not in the live cache`)
|
||||
countError(true)
|
||||
}
|
||||
return doc
|
||||
@@ -349,12 +347,7 @@ export class SearchEngine {
|
||||
const title = document?.path.toLowerCase() ?? ''
|
||||
const content = (document?.cleanedContent ?? '').toLowerCase()
|
||||
return exactTerms.every(
|
||||
q =>
|
||||
content.includes(q) ||
|
||||
removeDiacritics(
|
||||
title,
|
||||
this.plugin.settings.ignoreArabicDiacritics
|
||||
).includes(q)
|
||||
q => content.includes(q) || removeDiacritics(title).includes(q)
|
||||
)
|
||||
})
|
||||
}
|
||||
@@ -524,11 +517,7 @@ export class SearchEngine {
|
||||
}
|
||||
return (doc as any)[fieldName]
|
||||
},
|
||||
processTerm: (term: string) =>
|
||||
(this.plugin.settings.ignoreDiacritics
|
||||
? removeDiacritics(term, this.plugin.settings.ignoreArabicDiacritics)
|
||||
: term
|
||||
).toLowerCase(),
|
||||
processTerm: (term: string) => removeDiacritics(term).toLowerCase(),
|
||||
idField: 'path',
|
||||
fields: [
|
||||
'basename',
|
||||
|
||||
Reference in New Issue
Block a user