mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-03-04 11:57:44 +01:00
Modify weightings for fuzzy group search
This commit is contained in:
parent
1c44df8079
commit
bc94e3992f
@ -1872,7 +1872,7 @@ export function fuzzySearchCharacters(searchValue) {
|
|||||||
const fuse = new Fuse(characters, {
|
const fuse = new Fuse(characters, {
|
||||||
keys: [
|
keys: [
|
||||||
{ name: 'data.name', weight: 8 },
|
{ 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.description', weight: 3 },
|
||||||
{ name: 'data.mes_example', weight: 3 },
|
{ name: 'data.mes_example', weight: 3 },
|
||||||
{ name: 'data.scenario', weight: 2 },
|
{ name: 'data.scenario', weight: 2 },
|
||||||
@ -1975,8 +1975,10 @@ export function fuzzySearchGroups(searchValue) {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const fuse = new Fuse(groups, {
|
const fuse = new Fuse(groups, {
|
||||||
keys: [
|
keys: [
|
||||||
{ name: 'name', weight: 3 },
|
{ name: 'name', weight: 8 },
|
||||||
{ name: 'members', weight: 1 },
|
{ name: 'members', weight: 5 },
|
||||||
|
{ name: '#tags', weight: 5, getFn: (group) => getTagsList(group.id).map(x => x.name).join('||') },
|
||||||
|
{ name: 'id', weight: 1 },
|
||||||
],
|
],
|
||||||
includeScore: true,
|
includeScore: true,
|
||||||
ignoreLocation: true,
|
ignoreLocation: true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user