From f4cb1194c64aad4f6fc51ed41d57c959fb23d81b Mon Sep 17 00:00:00 2001 From: Ken Powers Date: Wed, 5 Jun 2019 21:06:45 -0700 Subject: [PATCH] Tune emoji search --- ts/components/emoji/lib.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ts/components/emoji/lib.ts b/ts/components/emoji/lib.ts index a87190e48c..d58550afb9 100644 --- a/ts/components/emoji/lib.ts +++ b/ts/components/emoji/lib.ts @@ -131,15 +131,15 @@ export function getSheetCoordinates( const fuse = new Fuse(data, { shouldSort: true, threshold: 0.3, - location: 0, - distance: 5, - maxPatternLength: 20, + location: 4, + distance: 10, + maxPatternLength: 32, minMatchCharLength: 1, keys: ['name', 'short_name', 'short_names'], }); export function search(query: string) { - return fuse.search(query); + return fuse.search(query.substr(0, 32)); } const shortNames = new Set([