[web] Unicode search (#5944)

Fixes: https://github.com/ente-io/ente/issues/5942
This commit is contained in:
Manav Rathi
2025-05-16 19:35:47 +05:30
committed by GitHub

View File

@@ -85,9 +85,10 @@ export class SearchWorker {
) {
return suggestionsForString(
s,
// Case insensitive word prefix match, considering underscores also
// as a word separator.
new RegExp("(\\b|_)" + s, "i"),
// Case insensitive word prefix match. Note that \b doesn't work
// with unicode characters, so we use instead a set of common
// punctuation (and spaces) to discern the word boundary.
new RegExp("(^|[\\s.,!?\"'-_])" + s, "i"),
searchString,
this.collectionsAndFiles,
this.people,