1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-12 22:57:38 +02:00

All: Improved support for Japanese, Chinese, Korean search queries (also applies to Goto Anything)

This commit is contained in:
Laurent Cozic
2019-04-03 07:46:41 +01:00
parent 252d937405
commit 72b36522e8
4 changed files with 44 additions and 10 deletions

View File

@ -358,6 +358,20 @@ class Note extends BaseItem {
return this.modelSelectOne('SELECT ' + this.previewFieldsSql(options.fields) + ' FROM notes WHERE is_conflict = 0 AND id = ?', [noteId]);
}
static async search(options = null) {
if (!options) options = {};
if (!options.conditions) options.conditions = [];
if (!options.conditionsParams) options.conditionsParams = [];
if (options.bodyPattern) {
const pattern = options.bodyPattern.replace(/\*/g, '%');
options.conditions.push('body LIKE ?');
options.conditionsParams.push(pattern);
}
return super.search(options);
}
static conflictedNotes() {
return this.modelSelectAll('SELECT * FROM notes WHERE is_conflict = 1');
}