diff --git a/src/modules/qqbot/plugins/bangdream/src/domain/search/fuzzy-search.ts b/src/modules/qqbot/plugins/bangdream/src/domain/search/fuzzy-search.ts index 9f0005a..71a38ca 100644 --- a/src/modules/qqbot/plugins/bangdream/src/domain/search/fuzzy-search.ts +++ b/src/modules/qqbot/plugins/bangdream/src/domain/search/fuzzy-search.ts @@ -278,7 +278,7 @@ export function match( } if (matchesOnlyAll(matches, keyCount)) { - return matches._all.some((keyword) => + return matches._all.every((keyword) => targetIncludesAllKeyword(target, keyword), ); } diff --git a/test/qqbot/plugins/bangdream/search/fuzzy-search.spec.ts b/test/qqbot/plugins/bangdream/search/fuzzy-search.spec.ts index df2b627..4b67f9b 100644 --- a/test/qqbot/plugins/bangdream/search/fuzzy-search.spec.ts +++ b/test/qqbot/plugins/bangdream/search/fuzzy-search.spec.ts @@ -38,6 +38,12 @@ describe('BangDream fuzzy search helpers', () => { expect(match({ _all: ['summer'] }, { title: ['Summer Dive'] }, [])).toBe( true, ); + expect( + match({ _all: ['fire', 'bird'] }, { title: ['FIRE BIRD'] }, []), + ).toBe(true); + expect( + match({ _all: ['fire', 'bird'] }, { title: ['Light a fire'] }, []), + ).toBe(false); expect( match( { scoreUpMaxValue: [100], _number: [100] },