From bc94e3992f008d3f5279099f863c424fc2e0947d Mon Sep 17 00:00:00 2001 From: Wolfsblvt Date: Tue, 30 Apr 2024 05:40:31 +0200 Subject: [PATCH] Modify weightings for fuzzy group search --- public/scripts/power-user.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/public/scripts/power-user.js b/public/scripts/power-user.js index e107d0968..03aa7fc10 100644 --- a/public/scripts/power-user.js +++ b/public/scripts/power-user.js @@ -1872,7 +1872,7 @@ export function fuzzySearchCharacters(searchValue) { const fuse = new Fuse(characters, { keys: [ { name: 'data.name', weight: 8 }, - { name: '#tags.name', weight: 5, getFn: (character) => getTagsList(character.avatar).map(x => x.name).join('||') }, + { name: '#tags', weight: 5, getFn: (character) => getTagsList(character.avatar).map(x => x.name).join('||') }, { name: 'data.description', weight: 3 }, { name: 'data.mes_example', weight: 3 }, { name: 'data.scenario', weight: 2 }, @@ -1975,8 +1975,10 @@ export function fuzzySearchGroups(searchValue) { // @ts-ignore const fuse = new Fuse(groups, { keys: [ - { name: 'name', weight: 3 }, - { name: 'members', weight: 1 }, + { name: 'name', weight: 8 }, + { name: 'members', weight: 5 }, + { name: '#tags', weight: 5, getFn: (group) => getTagsList(group.id).map(x => x.name).join('||') }, + { name: 'id', weight: 1 }, ], includeScore: true, ignoreLocation: true,