Поправки багов поиска

This commit is contained in:
Book Pauk
2022-10-23 19:10:13 +07:00
parent 784dda03fd
commit f1267879af
2 changed files with 3 additions and 2 deletions

View File

@@ -4,6 +4,7 @@ const utils = require('./utils');
const maxMemCacheSize = 100;
const emptyFieldValue = '?';
const maxUtf8Char = String.fromCodePoint(0xFFFFF);
const ruAlphabet = 'абвгдеёжзийклмнопрстуфхцчшщъыьэюя';
const enAlphabet = 'abcdefghijklmnopqrstuvwxyz';
@@ -45,7 +46,7 @@ class DbSearcher {
a = a.substring(1);
where = `@indexIter('value', (v) => {
const enru = new Set(${db.esc(enruArr)});
return !v || (!enru.has(v[0]) && v.indexOf(${db.esc(a)}) >= 0);
return !v || (v !== ${db.esc(emptyFieldValue)} && !enru.has(v[0]) && v.indexOf(${db.esc(a)}) >= 0);
})`;
} else {
where = `@dirtyIndexLR('value', ${db.esc(a)}, ${db.esc(a + maxUtf8Char)})`;