fix(search): resolve compilation issue due to variables with the same name
Some checks failed
Checks / main (push) Has been cancelled

This commit is contained in:
perf3ct 2025-11-03 11:44:43 -08:00
parent 8d88411fda
commit 2a0472ae42
No known key found for this signature in database
GPG Key ID: 569C4EEC436F5232

View File

@ -96,14 +96,14 @@ class NoteContentFulltextExp extends Expression {
// For exact match with flatText, also search notes WITHOUT content (they may have matching attributes) // For exact match with flatText, also search notes WITHOUT content (they may have matching attributes)
if (this.flatText && (this.operator === "=" || this.operator === "!=")) { if (this.flatText && (this.operator === "=" || this.operator === "!=")) {
for (const noteId of inputNoteSet.noteIdSet) { for (const note of inputNoteSet.notes) {
// Skip if already found or doesn't exist // Skip if already found or doesn't exist
if (resultNoteSet.hasNoteId(noteId) || !(noteId in becca.notes)) { if (resultNoteSet.hasNoteId(note.noteId) || !(note.noteId in becca.notes)) {
continue; continue;
} }
const note = becca.notes[noteId]; const noteFromBecca = becca.notes[note.noteId];
const flatText = note.getFlatText(); const flatText = noteFromBecca.getFlatText();
// For flatText, only check attribute values (format: #name=value or ~name=value) // For flatText, only check attribute values (format: #name=value or ~name=value)
// Don't match against noteId, type, mime, or title which are also in flatText // Don't match against noteId, type, mime, or title which are also in flatText
@ -116,7 +116,7 @@ class NoteContentFulltextExp extends Expression {
matches = normalizedFlatText.includes(`=${normalizedPhrase}`); matches = normalizedFlatText.includes(`=${normalizedPhrase}`);
if ((this.operator === "=" && matches) || (this.operator === "!=" && !matches)) { if ((this.operator === "=" && matches) || (this.operator === "!=" && !matches)) {
resultNoteSet.add(note); resultNoteSet.add(noteFromBecca);
} }
} }
} }